and-> chaining between calls * * @property-read mixed $and */ class AndObject extends BaseIntermediateObject { public function __get($name) { if($name == 'and') return $this->_value; } } /** * Refers to the currently active value */ class ItObject { private static $_instance; public static function getInstance() { if(!self::$_instance) self::$_instance = new ItObject(); return self::$_instance; } } /** * Used to refer to methods of the currently active value if its a class */ class ItsObject { private static $_instance; private $_method; private function __construct() { } public static function getInstance() { if(!self::$_instance) self::$_instance = new ItsObject(); return self::$_instance; } /** * sets method name * @param string $name * @return ItsObject $this */ public function method($name) { $this->_method = $name; return $this; } /** * Returns method name. Used internally * @return string */ public function getMethod() { return $this->_method; } }