entityTypeManager = $entityTypeManager; $this->entityTypeBundleInfo = $entityTypeBundleInfo; $this->entityQuery = $entity_query; } public function getTypes() { return $this->entityQuery->get('heartbeat_type')->sort('weight', 'ASC')->execute(); } public function load($id) { return $this->entityTypeManager->getStorage('heartbeat_type')->load($id); } public function getEntityBundles(ContentEntityType $entity) { return $this->entityTypeBundleInfo->getBundleInfo($entity->id()); } }