You are here

public function Drupal7::module_invoke_all in Service Container 7.2

Same name and namespace in other branches
  1. 7 src/Legacy/Drupal7.php \Drupal\service_container\Legacy\Drupal7::module_invoke_all()

Invokes a hook in all enabled modules that implement it.

All arguments are passed by value. Use drupal_alter() if you need to pass arguments by reference.

Parameters

$hook: The name of the hook to invoke.

...: Arguments to pass to the hook.

Return value

array An array of return values of the hook implementations. If modules return arrays from their implementations, those are merged into one array.

See also

drupal_alter()

File

src/Legacy/Drupal7.php, line 320
Contains \Drupal\service_container\Legacy\Drupal7.

Class

Drupal7
Defines the Drupal 7 legacy service.

Namespace

Drupal\service_container\Legacy

Code

public function module_invoke_all($hook) {
  $args = func_get_args();

  // Remove $hook from the arguments.
  unset($args[0]);
  return module_invoke_all($hook, $args);
}