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 51  
Class
- Hook
 - This class will not have an effect until Drupal 11.1.0.
 
Namespace
Drupal\Core\Hook\AttributeCode
public function setMethod(string $method) : static {
  $this->method = $method;
  return $this;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.