Esempio n. 1
0
 /**
  * Registers all the models defined in the include paths
  * @return array Array with the registered models
  */
 private function registerModels()
 {
     $models = $this->modelReader->readModelsFromIncludePaths();
     $register = new ModelRegister();
     $register->registerModels($models);
     $models = $register->getModels();
     $this->index = array_keys($models);
     $modelManager = ModelManager::getInstance();
     foreach ($models as $model) {
         $modelManager->addModel($model);
     }
     $cache = $modelManager->getModelCache();
     foreach ($models as $model) {
         $meta = $model->getMeta();
         $meta->getProperties();
         // make sure the meta is parsed before caching the model
         $cache->setModel($model);
     }
     return $models;
 }
Esempio n. 2
0
 /**
  * Store the defined models of this builder
  * @param array Array with Model objects
  * @return null
  */
 private function writeBuilderModels(array $models)
 {
     $modelIO = $this->modelReader->getModelIO();
     $modelIO->writeModelsToPath($this->directory, $models);
 }