function ReactionRuleStorage::getRegisteredEvents

Returns a list of event names that are used by active reaction rules.

Return value

string[] The list of event names keyed by event name.

2 calls to ReactionRuleStorage::getRegisteredEvents()
ReactionRuleStorage::delete in src/Entity/ReactionRuleStorage.php
Deletes permanently saved entities.
ReactionRuleStorage::save in src/Entity/ReactionRuleStorage.php
Implements Drupal\Core\Entity\EntityStorageInterface::save().

File

src/Entity/ReactionRuleStorage.php, line 96

Class

ReactionRuleStorage
Storage handler for Reaction Rule configuration entities.

Namespace

Drupal\rules\Entity

Code

protected function getRegisteredEvents() {
    $events = [];
    // 'status' == TRUE when the reaction rule is active.
    foreach ($this->loadByProperties([
        'status' => TRUE,
    ]) as $rules_config) {
        foreach ($rules_config->getEventNames() as $event_name) {
            $event_name = $this->eventManager
                ->getEventBaseName($event_name);
            if (!isset($events[$event_name])) {
                $events[$event_name] = $event_name;
            }
        }
    }
    return $events;
}