/** * Retrieve block tags and add it to processor * * @param Varien_Event_Observer $observer * @return Enterprise_PageCache_Model_Observer */ public function registerBlockTags(Varien_Event_Observer $observer) { if (!$this->isCacheEnabled()) { return $this; } /** @var $block Mage_Core_Block_Abstract*/ $block = $observer->getEvent()->getBlock(); if (in_array($block->getType(), array_keys($this->_config->getDeclaredPlaceholders()))) { return $this; } $tags = $block->getCacheTags(); if (empty($tags)) { return $this; } $key = array_search(Mage_Core_Block_Abstract::CACHE_GROUP, $tags); if (false !== $key) { unset($tags[$key]); } if (empty($tags)) { return $this; } $this->_processor->addRequestTag($tags); return $this; }
/** * Remove last block from context * * @param Mage_Core_Block_Abstract $block */ public function unregisterContext(Mage_Core_Block_Abstract $block) { if (in_array($block->getType(), array_keys($this->_config->getDeclaredPlaceholders()))) { array_pop($this->_context); } }