You are here

public function InvalidationBase::removeStateContext in Purge 8.3

Remove a state context from the object because the purger no longer exists.

Parameters

string $purger_instance_id: The instance ID of the purger to wipe from the invalidation.

Throws

\LogicException Thrown when the value is incorrect or when NOT operating in NULL context.

Overrides InvalidationInterface::removeStateContext

File

src/Plugin/Purge/Invalidation/InvalidationBase.php, line 82

Class

InvalidationBase
Provides base implementations for the invalidation object.

Namespace

Drupal\purge\Plugin\Purge\Invalidation

Code

public function removeStateContext($purger_instance_id) {
  if (!is_null($this->context)) {
    throw new \LogicException('Cannot remove a state context in purger context.');
  }
  if (!isset($this->states[$purger_instance_id])) {
    throw new \LogicException('Parameter $purger_instance_id is invalid!');
  }
  unset($this->states[$purger_instance_id]);
  unset($this->properties[$purger_instance_id]);
}