function AccessResultReasonInterface::setReason

Same name in other branches
  1. 9 core/lib/Drupal/Core/Access/AccessResultReasonInterface.php \Drupal\Core\Access\AccessResultReasonInterface::setReason()
  2. 8.9.x core/lib/Drupal/Core/Access/AccessResultReasonInterface.php \Drupal\Core\Access\AccessResultReasonInterface::setReason()
  3. 11.x core/lib/Drupal/Core/Access/AccessResultReasonInterface.php \Drupal\Core\Access\AccessResultReasonInterface::setReason()

Sets the reason for this access result.

Parameters

string|null $reason: The reason of this access result or NULL if no reason is provided.

Return value

\Drupal\Core\Access\AccessResultInterface The access result instance.

2 methods override AccessResultReasonInterface::setReason()
AccessResultForbidden::setReason in core/lib/Drupal/Core/Access/AccessResultForbidden.php
Sets the reason for this access result.
AccessResultNeutral::setReason in core/lib/Drupal/Core/Access/AccessResultNeutral.php
Sets the reason for this access result.

File

core/lib/Drupal/Core/Access/AccessResultReasonInterface.php, line 35

Class

AccessResultReasonInterface
Interface for access result value objects with stored reason for developers.

Namespace

Drupal\Core\Access

Code

public function setReason($reason);

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