function ChainRequestPolicy::addPolicy

Same name in other branches
  1. 9 core/lib/Drupal/Core/PageCache/ChainRequestPolicy.php \Drupal\Core\PageCache\ChainRequestPolicy::addPolicy()
  2. 8.9.x core/lib/Drupal/Core/PageCache/ChainRequestPolicy.php \Drupal\Core\PageCache\ChainRequestPolicy::addPolicy()
  3. 10 core/lib/Drupal/Core/PageCache/ChainRequestPolicy.php \Drupal\Core\PageCache\ChainRequestPolicy::addPolicy()

Overrides ChainRequestPolicyInterface::addPolicy

2 calls to ChainRequestPolicy::addPolicy()
DefaultRequestPolicy::__construct in core/modules/dynamic_page_cache/src/PageCache/RequestPolicy/DefaultRequestPolicy.php
Constructs the default Dynamic Page Cache request policy.
DefaultRequestPolicy::__construct in core/lib/Drupal/Core/PageCache/DefaultRequestPolicy.php
Constructs the default page cache request policy.

File

core/lib/Drupal/Core/PageCache/ChainRequestPolicy.php, line 55

Class

ChainRequestPolicy
Implements a compound request policy.

Namespace

Drupal\Core\PageCache

Code

public function addPolicy(RequestPolicyInterface $policy) {
    $this->rules[] = $policy;
    return $this;
}

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