CRUDlex\ServiceProvider::getData PHP Method

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
    public function getData($name)
    {
        if (!array_key_exists($name, $this->datas)) {
            return null;
        }
        return $this->datas[$name];
    }

Usage Example

コード例 #1
0
ファイル: TestDBSetup.php プロジェクト: philiplb/crudlexuser
 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;
 }
All Usage Examples Of CRUDlex\ServiceProvider::getData