Ejemplo n.º 1
1
 /**
  * {@inheritdoc}
  */
 public function getCacheContexts()
 {
     // The block by itself doesn't really vary by user, but some of its
     // implementations are (collection module, I'm looking at you). For the sake
     // of semplicity, we add the user context here already.
     $contexts = parent::getCacheContexts();
     return Cache::mergeContexts($contexts, ['user']);
 }
Ejemplo n.º 2
1
 /**
  * {@inheritdoc}
  */
 public function getCacheContexts()
 {
     return Cache::mergeContexts(parent::getCacheContexts(), ['route.book_navigation']);
 }
Ejemplo n.º 3
0
 /**
  * {@inheritdoc}
  */
 public function getCacheContexts()
 {
     return Cache::mergeContexts(parent::getCacheContexts(), ['route']);
 }
Ejemplo n.º 4
0
 /**
  * {@inheritdoc}
  */
 public function getCacheContexts()
 {
     return Cache::mergeContexts(parent::getCacheContexts(), ['user.node_grants:view']);
 }
Ejemplo n.º 5
0
 /**
  * {@inheritdoc}
  */
 public function getCacheContexts()
 {
     // ::build() uses MenuLinkTreeInterface::getCurrentRouteMenuTreeParameters()
     // to generate menu tree parameters, and those take the active menu trail
     // into account. Therefore, we must vary the rendered menu by the active
     // trail of the rendered menu.
     // Additional cache contexts, e.g. those that determine link text or
     // accessibility of a menu, will be bubbled automatically.
     $menu_name = $this->getDerivativeId();
     return Cache::mergeContexts(parent::getCacheContexts(), ['route.menu_active_trails:' . $menu_name]);
 }
Ejemplo n.º 6
0
 /**
  * {@inheritdoc}
  */
 public function getCacheContexts()
 {
     return Cache::mergeContexts(parent::getCacheContexts(), ['is_masquerading']);
 }
Ejemplo n.º 7
0
 /**
  * {@inheritdoc}
  */
 public function getCacheContexts()
 {
     $context = parent::getCacheContexts();
     // The links are only visible for certain roles on certain collections.
     // Normally cache contexts are added automatically but these links depend on
     // an optional context which we manage ourselves.
     return Cache::mergeContexts($context, ['user', 'user.roles', 'collection', 'asset_release', 'solution', 'url.path']);
 }
Ejemplo n.º 8
0
 /**
  * {@inheritdoc}
  */
 public function getCacheContexts()
 {
     // The "Help" block must be cached per URL: help is defined for a
     // given path, and does not come with any access restrictions.
     return Cache::mergeContexts(parent::getCacheContexts(), ['url']);
 }
Ejemplo n.º 9
0
 /**
  * Implements \Drupal\Core\Entity\Entity::getCacheContexts().
  */
 public function getCacheContexts()
 {
     return Cache::mergeContexts(parent::getCacheContexts(), array('route'));
 }
 /**
  * {@inheritdoc}
  */
 public function getCacheContexts()
 {
     $parent_context = parent::getCacheContexts();
     return Cache::mergeContexts($parent_context, $this->ivwTracker->getCacheContexts());
 }