pickles/classes/Object.php
Josh Sherman 046d265347 Added the new classes and stuff.
git-svn-id: http://svn.cleancode.org/svn/pickles@30 4d10bc64-7434-11dc-a737-d2d0f8310089
2008-07-12 23:28:44 +00:00

49 lines
741 B
PHP

<?php
class Object {
protected $config = null;
public function __construct() {
$this->config = Config::getInstance();
}
public function __destruct() {
}
/*
// @todo maybe later
public function __get($variable) {
if (!isset($this->data[$variable])) {
$this->data[$variable] = null;
}
return $this->data[$variable];
}
*/
public function get($variable, $array_element = null) {
if (isset($this->$variable)) {
if (isset($array_element)) {
$array = $this->$variable;
if (isset($array[$array_element])) {
return $array[$array_element];
}
}
else {
return $this->$variable;
}
}
return false;
}
public function set($variable, $value) {
$this->$variable = $value;
}
}
?>