From 16cd366b13d950f72e12c977840fe0baebceacd4 Mon Sep 17 00:00:00 2001 From: Josh Sherman Date: Thu, 11 Mar 2010 20:54:03 -0500 Subject: [PATCH] Refactored the Object class. --- classes/Object.php | 65 ++++++++++++++++------------------------------ 1 file changed, 22 insertions(+), 43 deletions(-) diff --git a/classes/Object.php b/classes/Object.php index 9a39623..406076f 100644 --- a/classes/Object.php +++ b/classes/Object.php @@ -3,25 +3,16 @@ /** * Object Class File for PICKLES * - * PICKLES is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. + * PHP version 5 * - * PICKLES is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * Licensed under the GNU General Public License Version 3 + * Redistribution of these files must retain the above copyright notice. * - * You should have received a copy of the GNU Lesser General Public - * License along with PICKLES. If not, see - * . - * - * @author Joshua John Sherman - * @copyright Copyright 2007, 2008 Joshua John Sherman + * @package pickles + * @author Josh Sherman + * @copyright Copyright 2007-2010, Gravity Boulevard, LLC + * @license http://www.gnu.org/licenses/gpl.html GPL v3 * @link http://phpwithpickles.org - * @license http://www.gnu.org/copyleft/lesser.html - * @package PICKLES */ /** @@ -32,39 +23,27 @@ * class already. This class handles getting an instance of the * Config object so that it's available. Also provides a getter * and setter for variables. + * + * @todo Implement a profiler in every object */ -class Object { +class Object +{ + /** + * Instance of the Config object + * + * @access protected + * @var object + */ + protected $config = null; /** * Constructor - */ - public function __construct() { } - - /** - * Destructor - */ - public function __destruct() { } - - /** * + * Establishes a Config instance for all children to enjoy */ - public function __get($variable) { - if (isset($this->$variable)) { - return $this->$variable; - } - - return null; - } - - /** - * Sets a variable - * - * @param string $variable Name of the variable to be set - * @param mixed $value Value to be assigned to the passed variable - * @todo Not sure we need this at all, grep to check if it's being used. - */ - public function set($variable, $value) { - $this->$variable = $value; + public function __construct() + { + $this->config = Config::getInstance(); } }