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 *