getData() public method

Getter for the {@see AbstractData} instances.
public getData ( string $name ) : AbstractData
$name string the entity name of the desired Data instance
return AbstractData the AbstractData instance or null on invalid name
Esempio n. 1
0
 public static function createServiceProvider($useManyToMany)
 {
     self::$fileProcessor = new NullFileProcessor();
     $app = self::createAppAndDB($useManyToMany);
     $crudServiceProvider = new ServiceProvider();
     $dataFactory = new MySQLDataFactory($app['db']);
     $crudFile = __DIR__ . '/../' . ($useManyToMany ? 'crudManyToMany.yml' : 'crud.yml');
     $crudServiceProvider->init($dataFactory, $crudFile, self::$fileProcessor, true, $app);
     $userSetup = new UserSetup();
     $userSetup->addEvents($crudServiceProvider->getData('user'));
     return $crudServiceProvider;
 }
Esempio n. 2
0
 public function testSetLocale()
 {
     $serviceProvider = new ServiceProvider();
     $app = new Application();
     $serviceProvider->init($this->dataFactory, $this->crudFile, $this->fileProcessorMock, true, $app);
     $serviceProvider->setLocale('de');
     $read = $serviceProvider->getData('library')->getDefinition()->getLocale();
     $expected = 'de';
     $this->assertSame($expected, $read);
     $read = $serviceProvider->getData('book')->getDefinition()->getLocale();
     $this->assertSame($expected, $read);
 }