AccessResultAllowed

Value object indicating an allowed access result, with cacheability metadata. Hierarchy class \Drupal\Core\Access\AccessResult implements AccessResultInterface, RefinableCacheableDependencyInterface uses RefinableCacheableDependencyTraitclass \Drupal\Core\Access\AccessResultAllowed File core/lib/Drupal/Core/Access/AccessResultAllowed.php, line 8 Namespace Drupal\Core\Access Members Name Modifiers Type Description AccessResult::allowed public static function Creates an A

AccessResult::setCacheMaxAge

public AccessResult::setCacheMaxAge($max_age) Sets the maximum age for which this access result may be cached. Parameters int $max_age: The maximum time in seconds that this access result may be cached. Return value $this File core/lib/Drupal/Core/Access/AccessResult.php, line 229 Class AccessResult Value object for passing an access result with cacheability metadata. Namespace Drupal\Core\Access Code public function setCacheMaxAge($max_age) { $this->cacheMaxAge = $max_age; re

AccessResult::resetCacheTags

public AccessResult::resetCacheTags() Resets cache tags (to the empty array). Return value $this File core/lib/Drupal/Core/Access/AccessResult.php, line 216 Class AccessResult Value object for passing an access result with cacheability metadata. Namespace Drupal\Core\Access Code public function resetCacheTags() { $this->cacheTags = []; return $this; }

AccessResult::resetCacheContexts

public AccessResult::resetCacheContexts() Resets cache contexts (to the empty array). Return value $this File core/lib/Drupal/Core/Access/AccessResult.php, line 206 Class AccessResult Value object for passing an access result with cacheability metadata. Namespace Drupal\Core\Access Code public function resetCacheContexts() { $this->cacheContexts = []; return $this; }

AccessResult::orIf

public AccessResult::orIf(AccessResultInterface $other) Combine this access result with another using OR. When OR-ing two access results, the result is: isForbidden() in either ⇒ isForbidden() otherwise if isAllowed() in either ⇒ isAllowed() otherwise both must be isNeutral() ⇒ isNeutral() Truth table: |A N F --+----- A |A A F N |A N F F |F F F Parameters \Drupal\Core\Access\AccessResultInterface $other: The other access result to OR this one with. Return value static Overrides AccessRes

AccessResult::neutral

public static AccessResult::neutral() Creates an AccessResultInterface object with isNeutral() === TRUE. Return value \Drupal\Core\Access\AccessResult isNeutral() will be TRUE. File core/lib/Drupal/Core/Access/AccessResult.php, line 37 Class AccessResult Value object for passing an access result with cacheability metadata. Namespace Drupal\Core\Access Code public static function neutral() { return new AccessResultNeutral(); }

AccessResult::isNeutral

public AccessResult::isNeutral() Overrides AccessResultInterface::isNeutral See also \Drupal\Core\Access\AccessResultNeutral File core/lib/Drupal/Core/Access/AccessResult.php, line 176 Class AccessResult Value object for passing an access result with cacheability metadata. Namespace Drupal\Core\Access Code public function isNeutral() { return FALSE; }

AccessResult::isForbidden

public AccessResult::isForbidden() Overrides AccessResultInterface::isForbidden See also \Drupal\Core\Access\AccessResultForbidden File core/lib/Drupal/Core/Access/AccessResult.php, line 167 Class AccessResult Value object for passing an access result with cacheability metadata. Namespace Drupal\Core\Access Code public function isForbidden() { return FALSE; }

AccessResult::isAllowed

public AccessResult::isAllowed() Overrides AccessResultInterface::isAllowed See also \Drupal\Core\Access\AccessResultAllowed File core/lib/Drupal/Core/Access/AccessResult.php, line 158 Class AccessResult Value object for passing an access result with cacheability metadata. Namespace Drupal\Core\Access Code public function isAllowed() { return FALSE; }

AccessResult::inheritCacheability

public AccessResult::inheritCacheability(AccessResultInterface $other) Inherits the cacheability of the other access result, if any. inheritCacheability() differs from addCacheableDependency() in how it handles max-age, because it is designed to inherit the cacheability of the second operand in the andIf() and orIf() operations. There, the situation "allowed, max-age=0 OR allowed, max-age=1000" needs to yield max-age 1000 as the end result. Parameters \Drupal\Core\Access\AccessResultInterface