You are here

public function InvalidationInterface::setProperty in Purge 8.3

Set a purger specific property.

Once ::setStateContext() has been called, purgers can call ::setProperty() and ::getProperty() to store specific metadata on the invalidation. The most common usecase for setting properties is for multi-step cache invalidation, for instance CDNs returning IDs to check against later.

Parameters

string $key: The key of the property to set, unique to the current purger context.

mixed $value: The value of the property.

Throws

\LogicException Thrown when operating in general context, call ::setStateContext() first.

1 method overrides InvalidationInterface::setProperty()
InvalidationBase::setProperty in src/Plugin/Purge/Invalidation/InvalidationBase.php
Set a purger specific property.

File

src/Plugin/Purge/Invalidation/InvalidationInterface.php, line 68

Class

InvalidationInterface
Desribes the invalidation object.

Namespace

Drupal\purge\Plugin\Purge\Invalidation

Code

public function setProperty($key, $value);