public function BusinessRulesListener::registerDynamicEvents in Business Rules 8
Same name and namespace in other branches
- 2.x src/EventSubscriber/BusinessRulesListener.php \Drupal\business_rules\EventSubscriber\BusinessRulesListener::registerDynamicEvents()
Rebuilds container when dynamic rule eventsubscribers are not registered.
Parameters
\Symfony\Component\EventDispatcher\Event $event: The event object.
string $event_name: The event name.
File
- src/
EventSubscriber/ BusinessRulesListener.php, line 192
Class
- BusinessRulesListener
- Class BusinessRulesListener.
Namespace
Drupal\business_rules\EventSubscriberCode
public function registerDynamicEvents(Event $event, $event_name) {
foreach (self::$staticEvents as $old_event_name => $method) {
$this->eventDispatcher
->removeListener($old_event_name, [
$this,
$method[0],
]);
}
$this->eventDispatcher
->addSubscriber($this);
$this->moduleHandler
->reload();
}