You are here

public function EventManager::eventTypeWithEntityType in RNG - Events and Registrations 3.x

Same name and namespace in other branches
  1. 8.2 src/EventManager.php \Drupal\rng\EventManager::eventTypeWithEntityType()
  2. 8 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\Entity\EventTypeInterface[] An array of event type config entities

Overrides EventManagerInterface::eventTypeWithEntityType

File

src/EventManager.php, line 88

Class

EventManager
Event manager for RNG.

Namespace

Drupal\rng

Code

public function eventTypeWithEntityType($entity_type) {
  $ids = $this->eventTypeStorage
    ->getQuery()
    ->condition('entity_type', $entity_type, '=')
    ->execute();
  if ($ids) {
    return $this->eventTypeStorage
      ->loadMultiple($ids);
  }
  return [];
}