function ConfigurableEventHandlerEntityBundle::determineQualifiedEvents

Overrides RulesConfigurableEventHandlerInterface::determineQualifiedEvents

File

src/EventHandler/ConfigurableEventHandlerEntityBundle.php, line 16

Class

ConfigurableEventHandlerEntityBundle
Exposes the bundle of an entity as event setting.

Namespace

Drupal\rules\EventHandler

Code

public static function determineQualifiedEvents(object $event, $event_name, array &$event_definition) {
    // @todo The 'object' type hint should be replaced with the appropriate
    // class once Symfony 4 is no longer supported.
    $events_suffixes = [];
    if ($event instanceof EntityEvent) {
        $events_suffixes[] = $event->getSubject()
            ->bundle();
    }
    return $events_suffixes;
}