data = $data; } /** * Get an entity type list. * * @return array */ public function getEntityTypeList() : array { return $this->data->getEntityTypeList(); } /** * Get an entity definitions list. * * @return array */ public function getEntityList() : array { $list = []; foreach ($this->getEntityTypeList() as $name) { $list[] = $this->getEntity($name); } return $list; } /** * Whether has an entity. */ public function hasEntity(string $name) : bool { return $this->data->hasEntity($name); } /** * Get entity definitions. */ public function getEntity(string $name) : EntityDefs { if (!$this->hasEntity($name)) { throw new RuntimeException("Entity type '{$name}' does not exist."); } return $this->data->getEntity($name); } }