You are here

protected function Tag::invalidateTagsOnSave in Extensible BBCode 8.3

Same name and namespace in other branches
  1. 4.0.x src/Entity/Tag.php \Drupal\xbbcode\Entity\Tag::invalidateTagsOnSave()

Override to never invalidate the entity's cache tag; the config system already invalidates it.

Overrides ConfigEntityBase::invalidateTagsOnSave

File

src/Entity/Tag.php, line 176

Class

Tag
Represents a custom XBBCode tag that can be altered by administrators.

Namespace

Drupal\xbbcode\Entity

Code

protected function invalidateTagsOnSave($update) : void {
  parent::invalidateTagsOnSave($update);

  // Rebuild the tag plugins.
  Drupal::service('plugin.manager.xbbcode')
    ->clearCachedDefinitions();

  // Filters can't tag their formats' cache, so invalidate it explicitly.
  if ($tags = $this
    ->filterFormatCacheTags()) {
    filter_formats_reset();
  }
  if (!$update) {

    // New tags affect all filters without a tag set.
    $tags['xbbcode_tag_new'] = 'xbbcode_tag_new';
  }
  if ($tags) {
    Cache::invalidateTags($tags);
  }
}