예제 #1
0
 /**
  * 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];
 }
예제 #2
0
 /**
  * {@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;
 }