/** * 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); }
/** * Get all registered adapters (by name => class) for a factory * * @return array */ public function getRegisteredAdapters() { return $this->builder->getRegisteredAdapters(get_called_class()); }
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; }