getConfiguration() 공개 정적인 메소드

Creates repository list configuration.
public static getConfiguration ( array $repositories ) : array
$repositories array
리턴 array
 /**
  * @return Model
  */
 public function create()
 {
     $config = Model::getConfiguration($this->repositories);
     $loader = new SimpleRepositoryLoader($this->repositories);
     $metadata = new MetadataStorage($this->storage, $config[2], $loader);
     $model = new Model($config, $loader, $metadata);
     foreach ($this->repositories as $repository) {
         $repository->setModel($model);
     }
     return $model;
 }
예제 #2
0
 public function beforeCompile()
 {
     $repositories = $this->prepareRepositories();
     $repositoriesConfig = Model::getConfiguration($repositories);
     $this->setupCache();
     $this->setupDependencyProvider();
     $this->setupMetadataParserFactory($this->config['metadataParserFactory']);
     $this->setupRepositoryLoader($repositories);
     $this->setupMetadataStorage($repositoriesConfig);
     $this->setupModel($this->config['model'], $repositoriesConfig);
 }
예제 #3
0
파일: OrmExtension.php 프로젝트: Vyki/orm
 public function loadConfiguration()
 {
     $config = $this->getConfig();
     if (!isset($config['model'])) {
         throw new InvalidStateException('Model is not defined.');
     }
     $repositories = $this->getRepositoryList($config['model']);
     $repositoriesConfig = Model::getConfiguration($repositories);
     $this->setupDependencyProvider();
     $this->setupRepositoryLoader($repositories);
     $this->setupMetadataStorage($repositoriesConfig);
     $this->setupRepositoriesAndMappers($repositories);
     $this->setupModel($config['model'], $repositoriesConfig);
 }