/**
  * {@inheritdoc}
  */
 public function postUpdate($object)
 {
     if ($this->cacheManager) {
         $this->cacheManager->invalidate(array('page_id' => $object->getId()));
     }
 }
 /**
  * {@inheritdoc}
  *
  * @param BaseBlock $object
  */
 public function postPersist($object)
 {
     $this->blockManager->get($object)->postPersist($object);
     $service = $this->blockManager->get($object);
     $this->cacheManager->invalidate($service->getCacheKeys($object));
 }
 /**
  * {@inheritdoc}
  */
 public function postPersist($object)
 {
     $this->cacheManager->invalidate(array('page_id' => $object->getPage()->getId()));
 }
Exemplo n.º 4
-1
 /**
  * @param BlockInterface $block
  * @param array          $stats
  *
  * @return CacheAdapterInterface
  */
 protected function getCacheService(BlockInterface $block, array &$stats = null)
 {
     if (!$this->cacheManager) {
         return false;
     }
     // type by block class
     $class = ClassUtils::getClass($block);
     $cacheServiceId = isset($this->cacheBlocks['by_class'][$class]) ? $this->cacheBlocks['by_class'][$class] : false;
     // type by block service
     if (!$cacheServiceId) {
         $cacheServiceId = isset($this->cacheBlocks['by_type'][$block->getType()]) ? $this->cacheBlocks['by_type'][$block->getType()] : false;
     }
     if (!$cacheServiceId) {
         return false;
     }
     if ($this->stopwatch) {
         $stats['cache']['handler'] = $cacheServiceId;
     }
     return $this->cacheManager->getCacheService($cacheServiceId);
 }