You are here

public function SiteAlertBlock::getCacheTags in Site Alert 8

The cache tags associated with this object.

When this object is modified, these cache tags will be invalidated.

Return value

string[] A set of cache tags.

Overrides ContextAwarePluginBase::getCacheTags

File

src/Plugin/Block/SiteAlertBlock.php, line 205

Class

SiteAlertBlock
Implements SiteAlertBlock class.

Namespace

Drupal\site_alert\Plugin\Block

Code

public function getCacheTags() {

  // The block should be invalidated whenever any site alert changes.
  $list_cache_tags = $this->entityTypeManager
    ->getDefinition('site_alert')
    ->getListCacheTags();
  return Cache::mergeTags(parent::getCacheTags(), $list_cache_tags);
}