/** * Creates a disconnected meta data factory with a database mapping driver * to get the meta data for the extension tables directly from the database. * * @return Doctrine\ORM\Tools\DisconnectedClassMetadataFactory */ private function getFactoryWithDatabaseDriver() { $driver = $this->getDatabaseDriver(); $this->em->getConfiguration()->setMetadataDriverImpl($driver); $factory = new DisconnectedClassMetadataFactory(); $factory->setEntityManager($this->em); return $factory; }
/** * Register components directory */ public function registerMyNamespace() { // Register Doctrine RegExp extension /** @var Configuration $config */ $config = $this->em->getConfiguration(); $classLoader = new \Doctrine\Common\ClassLoader('DoctrineExtensions', $this->Path() . 'Components/'); $classLoader->register(); $config->addCustomStringFunction('GroupConcat', 'DoctrineExtensions\\Query\\Mysql\\GroupConcat'); $this->get('loader')->registerNamespace('Shopware\\Components', $this->Path() . 'Components/'); $this->get('loader')->registerNamespace('Shopware\\Commands', $this->Path() . 'Commands/'); $this->get('loader')->registerNamespace('Shopware\\Subscriber', $this->Path() . 'Subscriber/'); $this->get('loader')->registerNamespace('Shopware\\Setup', $this->Path() . 'Setup/'); }
/** * ExtendedEntityManager constructor. * @param ModelManager $em */ public function __construct(ModelManager $em) { parent::__construct($em->getConnection(), $em->getConfiguration(), $em->getEventManager()); }