/** * Get the unique instance of the Object from the Registry. * * @return mixed - the object * @throws Waf_Exception if the object is not in the registry. */ public static function getRegistered() { $class = self::get_called_class(); if (Waf_Registry::isRegistered($class)) { return Waf_Registry::get($class); } else { throw new Waf_Exception($class . ' not registered'); } }
/** * Get the unique instance of the Object from the Registry. * * Defined by Waf_Registry_RegisterableInterface * * @return mixed - the object * @throws Waf_Exception if the object is not in the registry. */ public static function getRegistered() { $class = 'Waf_Model'; if (Waf_Registry::isRegistered($class)) { return Waf_Registry::get($class); } else { throw new Waf_Exception($class . ' not registered'); } }
public function testActiveSet() { Waf_Registry::getInstance()->foo = 'bar'; $this->assertEquals('bar', Waf_Registry::get('foo')); }