function ModuleHandler::invokeAllWith

Same name in other branches
  1. 9 core/lib/Drupal/Core/Extension/ModuleHandler.php \Drupal\Core\Extension\ModuleHandler::invokeAllWith()
  2. 10 core/lib/Drupal/Core/Extension/ModuleHandler.php \Drupal\Core\Extension\ModuleHandler::invokeAllWith()

Overrides ModuleHandlerInterface::invokeAllWith

1 call to ModuleHandler::invokeAllWith()
ModuleHandler::invokeAll in core/lib/Drupal/Core/Extension/ModuleHandler.php

File

core/lib/Drupal/Core/Extension/ModuleHandler.php, line 349

Class

ModuleHandler
Class that manages modules in a Drupal installation.

Namespace

Drupal\Core\Extension

Code

public function invokeAllWith(string $hook, callable $callback) : void {
    foreach ($this->getFlatHookListeners($hook) as $index => $listener) {
        $module = $this->modulesByHook[$hook][$index];
        $callback($listener, $module);
    }
}

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