Created
January 5, 2015 02:19
-
-
Save RabeaWahab/9f3df0530b616366441c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Packagename_Modulename_Model_Punchhole2 extends Enterprise_PageCache_Model_Container_Abstract | |
{ | |
protected function _getIdentifier() | |
{ | |
return $this->_getCookieValue(Enterprise_PageCache_Model_Cookie::COOKIE_CUSTOMER, ''); | |
} | |
/** | |
* Get cache identifier | |
* | |
* @return string | |
*/ | |
protected function _getCacheId() | |
{ | |
return 'HTML_CMSWIDGET_CACHED_ID' . md5($this->_placeholder->getAttribute('cache_id') . $this->_getIdentifier()); | |
} | |
/** | |
* Render block content | |
* | |
* @return string | |
*/ | |
protected function _renderBlock() | |
{ | |
$block = $this->_placeholder->getAttribute('block'); | |
if($block == 'Mage_Cms_Block_Widget_Block'){ | |
$block = 'Mage_Cms_Block_Block'; | |
} | |
$block = new $block; | |
// Get the block_id attribute we originally set in our CMS block's | |
// getCacheKeyInfo function. | |
$block_id = $this->_placeholder->getAttribute('block_id'); | |
$block->setBlockId($block_id); | |
$block->setLayout(Mage::app()->getLayout()); | |
return $block->toHtml(); | |
} | |
protected function _saveCache($data, $id, $tags = array(), $lifetime = null) | |
{ | |
return false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment