You are here

public function GroupStatisticBlock::getCacheTags in Open Social 8.9

Same name and namespace in other branches
  1. 8.8 modules/social_features/social_group/src/Plugin/Block/GroupStatisticBlock.php \Drupal\social_group\Plugin\Block\GroupStatisticBlock::getCacheTags()
  2. 10.3.x modules/social_features/social_group/src/Plugin/Block/GroupStatisticBlock.php \Drupal\social_group\Plugin\Block\GroupStatisticBlock::getCacheTags()
  3. 10.0.x modules/social_features/social_group/src/Plugin/Block/GroupStatisticBlock.php \Drupal\social_group\Plugin\Block\GroupStatisticBlock::getCacheTags()
  4. 10.1.x modules/social_features/social_group/src/Plugin/Block/GroupStatisticBlock.php \Drupal\social_group\Plugin\Block\GroupStatisticBlock::getCacheTags()
  5. 10.2.x modules/social_features/social_group/src/Plugin/Block/GroupStatisticBlock.php \Drupal\social_group\Plugin\Block\GroupStatisticBlock::getCacheTags()

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

modules/social_features/social_group/src/Plugin/Block/GroupStatisticBlock.php, line 112

Class

GroupStatisticBlock
Provides a 'GroupStatisticBlock' block.

Namespace

Drupal\social_group\Plugin\Block

Code

public function getCacheTags() {
  $group = _social_group_get_current_group();
  if (!$group instanceof GroupInterface) {
    return parent::getCacheContexts();
  }
  return Cache::mergeTags(parent::getCacheTags(), [
    'group_content_list:entity:' . \Drupal::currentUser()
      ->id(),
    'group_content_list:plugin:group_invitation:entity:' . \Drupal::currentUser()
      ->id(),
    'group:' . $group
      ->id(),
  ]);
}