class ChainResponsePolicy implements ChainResponsePolicyInterface (View source)

Provides a proxy class for \Drupal\Core\PageCache\ChainResponsePolicy.

Traits

Provides dependency injection friendly methods for serialization.

Properties

protected array $_serviceIds

An array of service IDs keyed by property name used for serialization.

from  DependencySerializationTrait
protected array $_entityStorages

An array of entity type IDs keyed by the property name of their storages.

from  DependencySerializationTrait
protected string $drupalProxyOriginalServiceId

The id of the original proxied service.

protected ChainResponsePolicy $service

The real proxied service, after it was lazy loaded.

protected ContainerInterface $container

The service container.

Methods

__sleep()

{@inheritdoc}

__wakeup()

{@inheritdoc}

__construct(ContainerInterface $container, string $drupal_proxy_original_service_id)

Constructs a ProxyClass Drupal proxy object.

object
lazyLoadItself()

Lazy loads the real service from the container.

string|null
check(Response $response, Request $request)

Determines whether it is save to store a page in the cache.

$this
addPolicy(ResponsePolicyInterface $policy)

Add a policy to the list of policy rules.

Details

__sleep()

{@inheritdoc}

__wakeup()

{@inheritdoc}

__construct(ContainerInterface $container, string $drupal_proxy_original_service_id)

Constructs a ProxyClass Drupal proxy object.

Parameters

ContainerInterface $container

The container.

string $drupal_proxy_original_service_id

The service ID of the original service.

protected object lazyLoadItself()

Lazy loads the real service from the container.

Return Value

object

Returns the constructed real service.

string|null check(Response $response, Request $request)

Determines whether it is save to store a page in the cache.

Parameters

Response $response

The response which is about to be sent to the client.

Request $request

The request object.

Return Value

string|null

Either static::DENY or NULL. Calling code may attempt to store a page in the cache unless static::DENY is returned. Returns NULL if the policy policy is not specified for the given response.

$this addPolicy(ResponsePolicyInterface $policy)

Add a policy to the list of policy rules.

Parameters

ResponsePolicyInterface $policy

The request policy rule to add.

Return Value

$this