You are here

protected function Host::invalidateTagsOnSave in http:BL 8

Invalidates an entity's cache tags upon save.

Override to always invalidate cache tags.

Overrides EntityBase::invalidateTagsOnSave

File

src/Entity/Host.php, line 185
Contains \Drupal\httpbl\Entity\Host.

Class

Host
Defines the host entity class.

Namespace

Drupal\httpbl\Entity

Code

protected function invalidateTagsOnSave($update) {
  $tags = $this
    ->getEntityType()
    ->getListCacheTags();
  if ($this
    ->hasLinkTemplate('canonical')) {

    // Creating or updating an entity may change a cached 403 or 404 response.
    $tags = Cache::mergeTags($tags, [
      '4xx-response',
    ]);
  }
  $tags = Cache::mergeTags($tags, $this
    ->getCacheTagsToInvalidate());
  Cache::invalidateTags($tags);
}