Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Hook.php

function Hook::setMethod

Set the method the hook should apply to.

Parameters

string $method: The method that the hook attribute applies to. This only needs to be set when the attribute is on the class.

File

core/lib/Drupal/Core/Hook/Attribute/Hook.php, line 121

Class

Hook
Attribute for defining a class method as a hook implementation.

Namespace

Drupal\Core\Hook\Attribute

Code

public function setMethod(string $method) : static {
    $this->method = $method;
    return $this;
}
RSS feed
Powered by Drupal