function EventManager::eventTypeWithEntityType in RNG - Events and Registrations 8
Same name and namespace in other branches
- 8.2 src/EventManager.php \Drupal\rng\EventManager::eventTypeWithEntityType()
- 3.x src/EventManager.php \Drupal\rng\EventManager::eventTypeWithEntityType()
Gets all event types associated with an entity type.
Parameters
string $entity_type: An entity type ID.
Return value
\Drupal\rng\EventTypeInterface[] An array of event type config entities
Overrides EventManagerInterface::eventTypeWithEntityType
File
- src/
EventManager.php, line 87
Class
- EventManager
- Event manager for RNG.
Namespace
Drupal\rngCode
function eventTypeWithEntityType($entity_type) {
$ids = $this->eventTypeStorage
->getQuery()
->condition('entity_type', $entity_type, '=')
->execute();
if ($ids) {
return $this->eventTypeStorage
->loadMultiple($ids);
}
return [];
}