You are here

public function ScheduledTransition::getCacheTagsToInvalidate in Scheduled Transitions 2.x

Same name and namespace in other branches
  1. 8 src/Entity/ScheduledTransition.php \Drupal\scheduled_transitions\Entity\ScheduledTransition::getCacheTagsToInvalidate()

Returns the cache tags that should be used to invalidate caches.

This will not return additional cache tags added through addCacheTags().

Return value

string[] Set of cache tags.

Overrides EntityBase::getCacheTagsToInvalidate

See also

\Drupal\Core\Cache\RefinableCacheableDependencyInterface::addCacheTags()

\Drupal\Core\Cache\CacheableDependencyInterface::getCacheTags()

File

src/Entity/ScheduledTransition.php, line 300

Class

ScheduledTransition
Scheduled Transition entity.

Namespace

Drupal\scheduled_transitions\Entity

Code

public function getCacheTagsToInvalidate() : array {
  $tags = parent::getCacheTagsToInvalidate();
  $entity = $this
    ->getEntity();
  if ($entity) {
    $tags[] = ScheduledTransitionsUtility::createScheduledTransitionsCacheTag($entity);
  }
  return $tags;
}