From c505fec77b57758801cd28eda3b139b2288a4f39 Mon Sep 17 00:00:00 2001 From: markjcrane Date: Wed, 20 Jan 2016 23:56:06 -0700 Subject: [PATCH] Update the constructor in the vcard class. --- resources/classes/vcard.php | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/resources/classes/vcard.php b/resources/classes/vcard.php index 34285d47d0..30f51bd85c 100644 --- a/resources/classes/vcard.php +++ b/resources/classes/vcard.php @@ -13,10 +13,10 @@ class vcard { var $revision_date; var $card; - /* - The class constructor. You can set some defaults here if desired. - */ - function vcard() { + /** + * Called when the object is created + */ + public function __construct() { $this->log = "New vcard() called
"; $this->data = array( "display_name"=>null @@ -59,7 +59,17 @@ class vcard { ,"sort_string"=>null ,"note"=>null ); - return true; + return true; + } + + /** + * Called when there are no references to a particular object + * unset the variables used in the class + */ + public function __destruct() { + foreach ($this as $key => $value) { + unset($this->$key); + } } /*