getStaticProperties(); } if (isset($static_properties[$class][$name])) { $value = $static_properties[$class][$name]; $parent = get_parent_class($class); if (!$parent) return $value; if (!isset($static_properties[$parent])) { $reflection = new ReflectionClass($parent); $static_properties[$parent] = $reflection->getStaticProperties(); } if (!isset($static_properties[$parent][$name]) || $static_properties[$parent][$name] !== $value) { return $value; } } } return $default; } public function __construct() { $this->class = get_class($this); $this->constructExtensions(); } // -------------------------------------------------------------------------------------------------------------- /** * Return true if this object "exists" i.e. has a sensible value * * This method should be overriden in subclasses to provide more context about the classes state. For example, a * {@link DataObject} class could return false when it is deleted from the database * * @return bool */ public function exists() { return true; } /** * @return string this classes parent class */ public function parentClass() { return get_parent_class($this); } /** * Check if this class is an instance of a specific class, or has that class as one of its parents * * @param string $class * @return bool */ public function is_a($class) { return $this instanceof $class; } /** * @return string the class name */ public function __toString() { return $this->class; } }