Esempio n. 1
0
 /**
  * Configure an identifier
  *
  * @param ObjectIdentifier $identifier
  * @param array $config
  * @return ObjectConfig
  */
 protected function _configure(ObjectIdentifier $identifier, $data)
 {
     //Prevent config settings from being stored in the identifier
     $config = clone $identifier->getConfig();
     //Merge the config data
     $config->append($data);
     //Set the service container and identifier
     $config->object_manager = $this;
     $config->object_identifier = $identifier;
     return $config;
 }
Esempio n. 2
0
 /**
  * Configure an identifier
  *
  * @param ObjectIdentifier $identifier
  * @param array             $data
  * @return ObjectConfig
  */
 protected function _configure(ObjectIdentifier $identifier, array $data = array())
 {
     //Prevent config settings from being stored in the identifier
     $config = clone $identifier->getConfig();
     //Append the config data from the singleton
     if ($identifier->getType() != 'lib' && $this->isSingleton($identifier)) {
         $parts = $identifier->toArray();
         unset($parts['type']);
         unset($parts['domain']);
         unset($parts['package']);
         //Append the config from the singleton
         $config->append($this->getIdentifier($parts)->getConfig());
     }
     //Append the config data for the object
     $config->append($data);
     //Set the service container and identifier
     $config->object_manager = $this;
     $config->object_identifier = $identifier;
     return $config;
 }