예제 #1
0
 /**
  * Create the locale-service
  *
  * @param \Zend\ServiceManager\ServiceLocatorInterface $serviceLocator
  * @return \Zork\Factory\Builder
  */
 public function createService(ServiceLocatorInterface $serviceLocator)
 {
     // Configure the locale
     $config = $serviceLocator->get('Configuration');
     $srvConfig = isset($config['factory']) ? $config['factory'] : array();
     return Builder::factory($srvConfig);
 }
예제 #2
0
 /**
  * Get all registered adapters (by name => class) for a factory
  *
  * @return array
  */
 public function getRegisteredAdapters()
 {
     return $this->builder->getRegisteredAdapters(get_called_class());
 }
예제 #3
0
 public function testChangeBuilder()
 {
     $builder = Builder::factory(array(__CLASS__ . '\\Factory' => array('dependency' => array(__CLASS__ . '\\Dependecy', 'Countable'), 'adapter' => array('adapter1' => __CLASS__ . '\\Adapter1', 'adapter2' => __CLASS__ . '\\Adapter2'))));
     $this->assertSame($this->builder, $this->factory->getFactoryBuilder());
     $this->factory->setFactoryBuilder($builder);
     $this->assertNotSame($this->builder, $this->factory->getFactoryBuilder());
     $this->builder = null;
     $this->builder = $builder;
 }