/** * @param string $controller * @param string $driver */ public function __construct($controller, $driver = self::DRIVER_DOCTRINE_ORM) { parent::__construct('locale', LocaleInterface::class, Locale::class); $orm = $driver === self::DRIVER_DOCTRINE_ORM; $this->setDriver($driver); $this->setDriverManager('default'); $this->setDriverMappingPath(realpath(__DIR__ . '/../Resources/Doctrine')); $this->setDriverMappingFormat(self::DRIVER_MAPPING_FORMAT_XML); $this->setRepository($orm ? DoctrineORMRepository::class : DoctrineMongoDBRepository::class); $this->setFactory(Factory::class); $this->setForm(LocaleType::class); $this->setChoiceForm($orm ? DoctrineORMLocaleChoiceType::class : DoctrineMongoDBLocaleChoiceType::class); $this->setDomainManager(DomainManager::class); $this->setController($controller); $this->setIdPropertyPath('code'); $this->setLabelPropertyPath('code'); }
/** * @param string $bundlePath * @param string $driver */ public function __construct($bundlePath, $driver = self::DRIVER_DOCTRINE_ORM) { $orm = $driver === self::DRIVER_DOCTRINE_ORM; parent::__construct('locale', $driver, 'default', $bundlePath . '/Resources/config/resources', self::DRIVER_MAPPING_FORMAT_XML, LocaleInterface::class, Locale::class, Controller::class, Factory::class, $orm ? DoctrineORMRepository::class : DoctrineMongoDBRepository::class, DomainManager::class, LocaleType::class, $orm ? DoctrineORMLocaleChoiceType::class : DoctrineMongoDBLocaleChoiceType::class, 'code', 'code'); }