Пример #1
0
 /**
  * Todo: Should be removed once GedmoExtension in the laravel-doctrine/extensions repo is tested to work
  * @param bool $all
  */
 public function enableGedmoExtensions($all = true)
 {
     if ($all) {
         DoctrineExtensions::registerMappingIntoDriverChainORM($this->driverChain->getChain(), $this->driverChain->getReader());
     } else {
         DoctrineExtensions::registerAbstractMappingIntoDriverChainORM($this->driverChain->getChain(), $this->driverChain->getReader());
     }
 }
Пример #2
0
 /**
  * Register the driver chain
  */
 protected function registerDriverChain()
 {
     $this->app->singleton(DriverChain::class, function ($app) {
         $configuration = $app['em']->getConfiguration();
         $chain = new DriverChain($configuration->getMetadataDriverImpl());
         // Register namespaces
         $namespaces = array_merge($app->config->get('doctrine.meta.namespaces', ['App']), ['LaravelDoctrine']);
         foreach ($namespaces as $namespace) {
             $chain->addNamespace($namespace);
         }
         // Register default paths
         $chain->addPaths(array_merge($app->config->get('doctrine.meta.paths', []), [__DIR__ . '/Auth/Passwords']));
         $configuration->setMetadataDriverImpl($chain->getChain());
         return $chain;
     });
 }