entityQuery = $entity_query; $this->entityTypeManager= $entity_type_manager; } public function getTypes() { return $this->entityQuery->get('status_type')->execute(); } public function load($id) { return $this->entityTypeManager->getStorage('status_type')->load($id); } public function loadAll() { return $this->entityTypeManager->getStorage('status_type')->loadMultiple($this->getTypes()); } }