/** * @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; }
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); }
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); }