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