From 08ac59670cd3417d3104498cdf7cb17e439a32b7 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Mon, 10 Dec 2018 17:05:02 -0700 Subject: [PATCH] Update conference_centers.php --- .../resources/classes/conference_centers.php | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/app/conference_centers/resources/classes/conference_centers.php b/app/conference_centers/resources/classes/conference_centers.php index 1c9a437a6a..1049bcf0b4 100644 --- a/app/conference_centers/resources/classes/conference_centers.php +++ b/app/conference_centers/resources/classes/conference_centers.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2008-2013 + Portions created by the Initial Developer are Copyright (C) 2008-2018 the Initial Developer. All Rights Reserved. Contributor(s): @@ -27,6 +27,7 @@ //define the conference center class class conference_centers { + public $db; public $domain_uuid; public $meeting_uuid; @@ -39,6 +40,29 @@ public $count; public $created_by; + /** + * Called when the object is created + */ + public function __construct() { + //connect to the database if not connected + if (!$this->db) { + require_once "resources/classes/database.php"; + $database = new database; + $database->connect(); + $this->db = $database->db; + } + } + + /** + * 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); + } + } + /** * count the conference rooms */