function ModuleHandlerInterface::hasImplementations

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Extension/ModuleHandlerInterface.php \Drupal\Core\Extension\ModuleHandlerInterface::hasImplementations()
  2. 10 core/lib/Drupal/Core/Extension/ModuleHandlerInterface.php \Drupal\Core\Extension\ModuleHandlerInterface::hasImplementations()

Determines whether there are implementations of a hook.

Parameters

string $hook: The name of the hook (e.g. "help" or "menu").

string|string[]|null $modules: (optional) A single module or multiple modules to check if they have any implementations of a hook. Use NULL to check if any enabled module has implementations.

Return value

bool If $modules is provided, then TRUE if there are any implementations by the module(s) provided. Or if $modules if NULL, then TRUE if there are any implementations. Otherwise FALSE.

1 method overrides ModuleHandlerInterface::hasImplementations()
ModuleHandler::hasImplementations in core/lib/Drupal/Core/Extension/ModuleHandler.php
Determines whether there are implementations of a hook.

File

core/lib/Drupal/Core/Extension/ModuleHandlerInterface.php, line 200

Class

ModuleHandlerInterface
Interface for classes that manage a set of enabled modules.

Namespace

Drupal\Core\Extension

Code

public function hasImplementations(string $hook, $modules = NULL) : bool;

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