You are here

class PurgeInvalidation in Purge 8.3

Defines a PurgeInvalidation annotation object.

Hierarchy

Expanded class hierarchy of PurgeInvalidation

8 classes are annotated with PurgeInvalidation
DomainInvalidation in src/Plugin/Purge/Invalidation/DomainInvalidation.php
Describes an entire domain to be invalidated.
EverythingInvalidation in src/Plugin/Purge/Invalidation/EverythingInvalidation.php
Describes that everything is to be invalidated.
PathInvalidation in src/Plugin/Purge/Invalidation/PathInvalidation.php
Describes path based invalidation, e.g. "news/article-1".
RegularExpressionInvalidation in src/Plugin/Purge/Invalidation/RegularExpressionInvalidation.php
Describes invalidation by regular expression, e.g.: '\.(jpg|jpeg|css|js)$'.
TagInvalidation in src/Plugin/Purge/Invalidation/TagInvalidation.php
Describes invalidation by Drupal cache tag, e.g.: 'user:1', 'menu:footer'.

... See full list

File

src/Annotation/PurgeInvalidation.php, line 12

Namespace

Drupal\purge\Annotation
View source
class PurgeInvalidation extends Plugin {

  /**
   * The plugin ID of the invalidation type.
   *
   * @var string
   */
  public $id;

  /**
   * The human-readable name of the invalidation type.
   *
   * @var \Drupal\Core\Annotation\Translation
   * @ingroup plugin_translatable
   */
  public $label;

  /**
   * The description of the invalidation type.
   *
   * @var \Drupal\Core\Annotation\Translation
   * @ingroup plugin_translatable
   */
  public $description;

  /**
   * Example expressions.
   *
   * Example expression strings that this type supports, shown to the user in
   * user interfaces as usability hints. Leave empty for types that don't
   * need expressions for instantiation, see $expression_required.
   *
   * @var string[]
   */
  public $examples = [];

  /**
   * Required expression.
   *
   * Whether invalidation objects of this type require a string expression that
   * describes what needs to be purged. If put to FALSE, the fact this type is
   * instantiated is deemed enough information for purgers to execute it.
   *
   * @var bool
   */
  public $expression_required = TRUE;

  // phpcs:ignore -- annotation property!

  /**
   * Can expressions be empty.
   *
   * When expression_required = TRUE, this determines whether a string
   * expression can be equal to "" (empty string). If FALSE, this invalidation
   * type can not be instantiated with empty expression strings.
   *
   * @var bool
   */
  public $expression_can_be_empty = FALSE;

  // phpcs:ignore -- annotation property!

  /**
   * Expression must be a string.
   *
   * When expression got passed but when it is not a string, this will result in
   * an error when its set to TRUE.
   *
   * @var bool
   */
  public $expression_must_be_string = FALSE;

}

Members

Namesort descending Modifiers Type Description Overrides
Plugin::$definition protected property The plugin definition read from the class annotation. 1
Plugin::get public function Gets the value of an annotation. Overrides AnnotationInterface::get 5
Plugin::getClass public function Gets the class of the annotated class. Overrides AnnotationInterface::getClass
Plugin::getId public function Gets the unique ID for this annotated class. Overrides AnnotationInterface::getId
Plugin::getProvider public function Gets the name of the provider of the annotated class. Overrides AnnotationInterface::getProvider
Plugin::parse protected function Parses an annotation into its definition.
Plugin::setClass public function Sets the class of the annotated class. Overrides AnnotationInterface::setClass
Plugin::setProvider public function Sets the name of the provider of the annotated class. Overrides AnnotationInterface::setProvider
Plugin::__construct public function Constructs a Plugin object. 2
PurgeInvalidation::$description public property The description of the invalidation type.
PurgeInvalidation::$examples public property Example expressions.
PurgeInvalidation::$expression_can_be_empty public property Can expressions be empty.
PurgeInvalidation::$expression_must_be_string public property Expression must be a string.
PurgeInvalidation::$expression_required public property Required expression.
PurgeInvalidation::$id public property The plugin ID of the invalidation type.
PurgeInvalidation::$label public property The human-readable name of the invalidation type.