function EntityTypeEventSubscriberTrait::getEntityTypeEvents

Same name in other branches
  1. 9 core/lib/Drupal/Core/Entity/EntityTypeEventSubscriberTrait.php \Drupal\Core\Entity\EntityTypeEventSubscriberTrait::getEntityTypeEvents()
  2. 10 core/lib/Drupal/Core/Entity/EntityTypeEventSubscriberTrait.php \Drupal\Core\Entity\EntityTypeEventSubscriberTrait::getEntityTypeEvents()
  3. 11.x core/lib/Drupal/Core/Entity/EntityTypeEventSubscriberTrait.php \Drupal\Core\Entity\EntityTypeEventSubscriberTrait::getEntityTypeEvents()

Gets the subscribed events.

Return value

array An array of subscribed event names.

See also

\Symfony\Component\EventDispatcher\EventSubscriberInterface::getSubscribedEvents()

4 calls to EntityTypeEventSubscriberTrait::getEntityTypeEvents()
EntitySchemaSubscriber::getSubscribedEvents in core/modules/workspaces/src/EventSubscriber/EntitySchemaSubscriber.php
EntitySchemaSubscriber::getSubscribedEvents in core/modules/system/tests/modules/entity_test_update/src/EventSubscriber/EntitySchemaSubscriber.php
EntityTestDefinitionSubscriber::getSubscribedEvents in core/modules/system/tests/modules/entity_test/src/EntityTestDefinitionSubscriber.php
ViewsEntitySchemaSubscriber::getSubscribedEvents in core/modules/views/src/EventSubscriber/ViewsEntitySchemaSubscriber.php

File

core/lib/Drupal/Core/Entity/EntityTypeEventSubscriberTrait.php, line 24

Class

EntityTypeEventSubscriberTrait
Helper methods for EntityTypeListenerInterface.

Namespace

Drupal\Core\Entity

Code

public static function getEntityTypeEvents() {
    $event = [
        'onEntityTypeEvent',
        100,
    ];
    $events[EntityTypeEvents::CREATE][] = $event;
    $events[EntityTypeEvents::UPDATE][] = $event;
    $events[EntityTypeEvents::DELETE][] = $event;
    return $events;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.