/**
  * Register the metadata
  *
  * @param DoctrineManager $manager
  */
 public function boot(DoctrineManager $manager)
 {
     $manager->extendAll(function (Configuration $configuration) {
         $configuration->setCustomDatetimeFunctions($this->datetime);
         $configuration->setCustomNumericFunctions($this->numeric);
         $configuration->setCustomStringFunctions($this->string);
     });
 }
Пример #2
0
 /**
  * @param DoctrineManager   $manager
  * @param Gate              $gate
  * @param PermissionManager $permissionManager
  */
 public function boot(DoctrineManager $manager, Gate $gate, PermissionManager $permissionManager)
 {
     if (!$this->isLumen()) {
         $this->publishes([$this->getConfigPath() => config_path('acl.php')], 'config');
     }
     $manager->extendAll(RegisterMappedEventSubscribers::class);
     if ($permissionManager->needsDoctrine()) {
         $manager->addPaths([__DIR__ . DIRECTORY_SEPARATOR . 'Permissions']);
     }
     $this->definePermissions($gate, $permissionManager);
 }
Пример #3
0
 public function test_can_add_paths_to_default_connection()
 {
     $this->registry->shouldReceive('getManager')->once()->with('default')->andReturn($this->em);
     $configuration = m::mock(Configuration::class);
     $mappingDriver = m::mock(MappingDriverChain::class);
     $mappingDriver->shouldReceive('addPaths')->once()->with(['paths']);
     $configuration->shouldReceive('getMetadataDriverImpl')->once()->andReturn($mappingDriver);
     $this->em->shouldReceive('getConfiguration')->once()->andReturn($configuration);
     $this->manager->addPaths(['paths'], 'default');
 }
 /**
  * @param DoctrineManager $manager
  */
 public function boot(DoctrineManager $manager)
 {
     // The path to PasswordReminder should be added, so the entity can be found
     $manager->addPaths([__DIR__]);
 }
Пример #5
0
 /**
  * 
  *
  * @param null $connection
  * @return \LaravelDoctrine\ORM\MappingDriver 
  * @static 
  */
 public static function getMetaDataDriver($connection = null)
 {
     return \LaravelDoctrine\ORM\DoctrineManager::getMetaDataDriver($connection);
 }
 public function test_custom_functions_can_be_registered()
 {
     $this->manager->shouldReceive('extendAll')->once();
     $this->provider->boot($this->manager);
 }