_client); unset($this->_loader); unset($this->_actionRepository); unset($this->_providerRepository); unset($this->_request); unset($this->_response); } // public function __construct() // { // // no instantiation from outside // } /** * Enter description here... * * @param Zend_Tool_Framework_Client_Abstract $client * @return Zend_Tool_Framework_Registry */ public function setClient(Zend_Tool_Framework_Client_Abstract $client) { $this->_client = $client; if ($this->isObjectRegistryEnablable($this->_client)) { $this->enableRegistryOnObject($this->_client); } return $this; } /** * getClient() return the client in the registry * * @return Zend_Tool_Framework_Client_Abstract */ public function getClient() { return $this->_client; } /** * setConfig() * * @param Zend_Tool_Framework_Client_Config $config * @return Zend_Tool_Framework_Registry */ public function setConfig(Zend_Tool_Framework_Client_Config $config) { $this->_config = $config; return $this; } /** * getConfig() * * @return Zend_Tool_Framework_Client_Config */ public function getConfig() { if ($this->_config === null) { $this->setConfig(new Zend_Tool_Framework_Client_Config()); } return $this->_config; } /** * setStorage() * * @param Zend_Tool_Framework_Client_Storage $storage * @return Zend_Tool_Framework_Registry */ public function setStorage(Zend_Tool_Framework_Client_Storage $storage) { $this->_storage = $storage; return $this; } /** * getConfig() * * @return Zend_Tool_Framework_Client_Storage */ public function getStorage() { if ($this->_storage === null) { $this->setStorage(new Zend_Tool_Framework_Client_Storage()); } return $this->_storage; } /** * setLoader() * * @param Zend_Tool_Framework_Loader_Interface $loader * @return Zend_Tool_Framework_Registry */ public function setLoader(Zend_Tool_Framework_Loader_Interface $loader) { $this->_loader = $loader; if ($this->isObjectRegistryEnablable($this->_loader)) { $this->enableRegistryOnObject($this->_loader); } return $this; } /** * getLoader() * * @return Zend_Tool_Framework_Loader_Abstract */ public function getLoader() { if ($this->_loader === null) { $this->setLoader(new Zend_Tool_Framework_Loader_IncludePathLoader()); } return $this->_loader; } /** * setActionRepository() * * @param Zend_Tool_Framework_Action_Repository $actionRepository * @return Zend_Tool_Framework_Registry */ public function setActionRepository(Zend_Tool_Framework_Action_Repository $actionRepository) { $this->_actionRepository = $actionRepository; if ($this->isObjectRegistryEnablable($this->_actionRepository)) { $this->enableRegistryOnObject($this->_actionRepository); } return $this; } /** * getActionRepository() * * @return Zend_Tool_Framework_Action_Repository */ public function getActionRepository() { if ($this->_actionRepository == null) { $this->setActionRepository(new Zend_Tool_Framework_Action_Repository()); } return $this->_actionRepository; } /** * setProviderRepository() * * @param Zend_Tool_Framework_Provider_Repository $providerRepository * @return Zend_Tool_Framework_Registry */ public function setProviderRepository(Zend_Tool_Framework_Provider_Repository $providerRepository) { $this->_providerRepository = $providerRepository; if ($this->isObjectRegistryEnablable($this->_providerRepository)) { $this->enableRegistryOnObject($this->_providerRepository); } return $this; } /** * getProviderRepository() * * @return Zend_Tool_Framework_Provider_Repository */ public function getProviderRepository() { if ($this->_providerRepository == null) { $this->setProviderRepository(new Zend_Tool_Framework_Provider_Repository()); } return $this->_providerRepository; } /** * setManifestRepository() * * @param Zend_Tool_Framework_Manifest_Repository $manifestRepository * @return Zend_Tool_Framework_Registry */ public function setManifestRepository(Zend_Tool_Framework_Manifest_Repository $manifestRepository) { $this->_manifestRepository = $manifestRepository; if ($this->isObjectRegistryEnablable($this->_manifestRepository)) { $this->enableRegistryOnObject($this->_manifestRepository); } return $this; } /** * getManifestRepository() * * @return Zend_Tool_Framework_Manifest_Repository */ public function getManifestRepository() { if ($this->_manifestRepository == null) { $this->setManifestRepository(new Zend_Tool_Framework_Manifest_Repository()); } return $this->_manifestRepository; } /** * setRequest() * * @param Zend_Tool_Framework_Client_Request $request * @return Zend_Tool_Framework_Registry */ public function setRequest(Zend_Tool_Framework_Client_Request $request) { $this->_request = $request; return $this; } /** * getRequest() * * @return Zend_Tool_Framework_Client_Request */ public function getRequest() { if ($this->_request == null) { $this->setRequest(new Zend_Tool_Framework_Client_Request()); } return $this->_request; } /** * setResponse() * * @param Zend_Tool_Framework_Client_Response $response * @return Zend_Tool_Framework_Registry */ public function setResponse(Zend_Tool_Framework_Client_Response $response) { $this->_response = $response; return $this; } /** * getResponse() * * @return Zend_Tool_Framework_Client_Response */ public function getResponse() { if ($this->_response == null) { $this->setResponse(new Zend_Tool_Framework_Client_Response()); } return $this->_response; } /** * __get() - Get a property via property call $registry->foo * * @param string $name * @return mixed */ public function __get($name) { if (method_exists($this, 'get' . $name)) { return $this->{'get' . $name}(); } else { throw new Zend_Tool_Framework_Registry_Exception('Property ' . $name . ' was not located in this registry.'); } } /** * __set() - Set a property via the magic set $registry->foo = 'foo' * * @param string $name * @param mixed $value */ public function __set($name, $value) { if (method_exists($this, 'set' . $name)) { $this->{'set' . $name}($value); return; } else { throw new Zend_Tool_Framework_Registry_Exception('Property ' . $name . ' was not located in this registry.'); } } /** * isObjectRegistryEnablable() - Check whether an object is registry enablable * * @param object $object * @return bool */ public function isObjectRegistryEnablable($object) { if (!is_object($object)) { throw new Zend_Tool_Framework_Registry_Exception('isObjectRegistryEnablable() expects an object.'); } return ($object instanceof Zend_Tool_Framework_Registry_EnabledInterface); } /** * enableRegistryOnObject() - make an object registry enabled * * @param object $object * @return Zend_Tool_Framework_Registry */ public function enableRegistryOnObject($object) { if (!$this->isObjectRegistryEnablable($object)) { throw new Zend_Tool_Framework_Registry_Exception('Object provided is not registry enablable, check first with Zend_Tool_Framework_Registry::isObjectRegistryEnablable()'); } $object->setRegistry($this); return $this; } }