You are here

public function SocialAlbumCountAndAddBlock::getCacheContexts in Open Social 10.1.x

Same name and namespace in other branches
  1. 10.3.x modules/social_features/social_album/src/Plugin/Block/SocialAlbumCountAndAddBlock.php \Drupal\social_album\Plugin\Block\SocialAlbumCountAndAddBlock::getCacheContexts()
  2. 10.0.x modules/social_features/social_album/src/Plugin/Block/SocialAlbumCountAndAddBlock.php \Drupal\social_album\Plugin\Block\SocialAlbumCountAndAddBlock::getCacheContexts()
  3. 10.2.x modules/social_features/social_album/src/Plugin/Block/SocialAlbumCountAndAddBlock.php \Drupal\social_album\Plugin\Block\SocialAlbumCountAndAddBlock::getCacheContexts()

Overrides ContextAwarePluginTrait::getCacheContexts

File

modules/social_features/social_album/src/Plugin/Block/SocialAlbumCountAndAddBlock.php, line 127

Class

SocialAlbumCountAndAddBlock
Provides a block to display images count and a button for adding new images.

Namespace

Drupal\social_album\Plugin\Block

Code

public function getCacheContexts() {
  $cache_contexts = parent::getCacheContexts();
  if ($this
    ->getProperties()) {
    $cache_contexts = Cache::mergeContexts($cache_contexts, [
      'url',
    ]);
  }
  return $cache_contexts;
}