示例#1
0
 /**
  * Takes in an Registry and returns a ProjectState matching it.
  *
  * @param Registry $registry
  *
  * @return ProjectState
  *
  * @since 1.1.0
  *
  * @author Eddilbert Macharia (http://eddmash.com) <*****@*****.**>
  */
 public static function fromApps($registry)
 {
     $modelStates = [];
     foreach ($registry->getModels() as $modelName => $modelObj) {
         $modelStates[$modelName] = ModelState::fromModel($modelObj);
     }
     return static::createObject($modelStates);
 }
示例#2
0
 /**
  * {@inheritdoc}
  */
 public function updateState($state)
 {
     $state->addModelState(ModelState::createObject($this->name, $this->fields, ['meta' => $this->meta, 'extends' => $this->extends]));
 }