From f82824395eabb9509a9e7743b6129be1de607011 Mon Sep 17 00:00:00 2001 From: No3x Date: Tue, 2 Jul 2013 15:38:25 +0200 Subject: [PATCH] Magic isset completion. --- vCard.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/vCard.php b/vCard.php index b2f0476..630ea79 100644 --- a/vCard.php +++ b/vCard.php @@ -338,7 +338,21 @@ public function __get($Key) } return array(); } - + + /** + * Magic method to check isset for the various vCard values as object members, e.g. + * a call to isset( $vCard -> fn ) checks existence of a value. + * + * @param string Key + * + * @return bool isset + */ + public function __isset($Key) { + $Key = strtolower($Key); + $val = $this->$Key; + return isset($val); + } + /** * Saves an embedded file *