You are here

protected function JobItem::invalidateTagsOnSave in Translation Management Tool 8

Invalidates an entity's cache tags upon save.

Parameters

bool $update: TRUE if the entity has been updated, or FALSE if it has been inserted.

Overrides EntityBase::invalidateTagsOnSave

File

src/Entity/JobItem.php, line 1088

Class

JobItem
Entity class for the tmgmt_job_item entity.

Namespace

Drupal\tmgmt\Entity

Code

protected function invalidateTagsOnSave($update) {
  parent::invalidateTagsOnSave($update);
  if ($this
    ->getJob()) {
    $tags = $this
      ->getJob()
      ->getEntityType()
      ->getListCacheTags();
    if ($update) {
      $tags = Cache::mergeTags($tags, $this
        ->getJob()
        ->getCacheTagsToInvalidate());
    }
    Cache::invalidateTags($tags);
  }
}