/** * Retrieve cached object instance * * @param string $type * @return mixed */ public function get($type) { $type = $this->_config->getPreference($type); if (!isset($this->_sharedInstances[$type])) { $this->_sharedInstances[$type] = $this->_factory->create($type); } return $this->_sharedInstances[$type]; }
/** * {@inheritdoc} */ public function create($requestedType, array $arguments = array()) { $this->log->startCreating($requestedType); $result = $this->subject->create($requestedType, $arguments); $loggerClassName = get_class($result) . "\\Logger"; $wrappedResult = new $loggerClassName($result, $this->log); $this->log->stopCreating($result); return $wrappedResult; }