function HookCollectorPass::addFromAttribute
Adds a Hook attribute implementation.
Parameters
\Drupal\Core\Hook\Attribute\Hook $hook: A hook attribute.
$class: The class in which said attribute resides in.
$module: The module in which the class resides in.
Return value
void
1 call to HookCollectorPass::addFromAttribute()
- HookCollectorPass::collectModuleHookImplementations in core/
lib/ Drupal/ Core/ Hook/ HookCollectorPass.php - Collects procedural and Attribute hook implementations.
File
-
core/
lib/ Drupal/ Core/ Hook/ HookCollectorPass.php, line 270
Class
- HookCollectorPass
- Collects and registers hook implementations.
Namespace
Drupal\Core\HookCode
protected function addFromAttribute(Hook $hook, $class, $module) {
if ($hook->module) {
$module = $hook->module;
}
$this->moduleImplements[$hook->hook][$module] = '';
$this->implementations[$hook->hook][$module][$class][] = $hook->method;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.