/**
  * {@inheritdoc}
  */
 public function getCacheKeys()
 {
     // Add a key for the active book trail.
     $current_bid = 0;
     if ($node = $this->requestStack->getCurrentRequest()->get('node')) {
         $current_bid = empty($node->book['bid']) ? 0 : $node->book['bid'];
     }
     if ($current_bid === 0) {
         return parent::getCacheKeys();
     }
     $active_trail = $this->bookManager->getActiveTrailIds($node->book['bid'], $node->book);
     $active_trail_key = 'trail.' . implode('|', $active_trail);
     return array_merge(parent::getCacheKeys(), array($active_trail_key));
 }
 /**
  * {@inheritdoc}
  */
 public function getCacheKeys()
 {
     // Add a key for the active menu trail.
     $menu = $this->getDerivativeId();
     return array_merge(parent::getCacheKeys(), array($this->menuActiveTrail->getActiveTrailCacheKey($menu)));
 }
示例#3
0
 /**
  * {@inheritdoc}
  */
 public function getCacheKeys()
 {
     return array_merge(parent::getCacheKeys(), Cache::keyFromQuery($this->buildForumQuery()));
 }