You are here

public function MemberCountBlock::getCacheTags in Organic groups 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/MemberCountBlock.php, line 151

Class

MemberCountBlock
Provides a block that shows the number of members in the current group.

Namespace

Drupal\og\Plugin\Block

Code

public function getCacheTags() {
  $tags = parent::getCacheTags();
  $group = $this->ogContext
    ->getGroup();
  if (!empty($group)) {
    $tags = Cache::mergeTags(Cache::buildTags(OgMembershipInterface::GROUP_MEMBERSHIP_LIST_CACHE_TAG_PREFIX, $group
      ->getCacheTagsToInvalidate()), $tags);
  }
  return $tags;
}