コード例 #1
0
ファイル: Block.php プロジェクト: staywithabhi/porto
 /**
  * {@inheritdoc}
  */
 public function getCacheKeyInfo()
 {
     $info = parent::getCacheKeyInfo();
     $blockId = $this->getBlockId();
     if ($blockId) {
         $info[] = 'CMSBLOCK_' . $blockId;
     }
     return $info;
 }
コード例 #2
0
ファイル: Block.php プロジェクト: MikeTayC/magento.dev
 /**
  * Retrieve values of properties that unambiguously identify unique content
  *
  * @return array
  */
 public function getCacheKeyInfo()
 {
     $blockId = $this->getBlockId();
     if ($blockId) {
         $result = array('CMS_BLOCK', $blockId, Mage::app()->getStore()->getCode());
     } else {
         $result = parent::getCacheKeyInfo();
     }
     return $result;
 }
コード例 #3
0
ファイル: Abstract.php プロジェクト: finelinePG/finelink-dev
 /**
  * Get generic key array including handle etc, that all blocks use
  *
  * @param Mage_Core_Block_Abstract $block
  * @return array
  */
 protected function _getBasicKeys(Mage_Core_Block_Abstract $block)
 {
     $keys = $block->getCacheKeyInfo();
     if (!is_array($keys)) {
         $keys = array();
     }
     $keys[] = Mage::getSingleton('customer/session')->getCustomer()->getGroupId();
     $keys[] = Mage::app()->getStore()->getCurrentCurrencyCode();
     $keys[] = $block->getLayout()->getUpdate()->getCacheId();
     $keys[] = 'SSL_' . intval(!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') . '_';
     return $keys;
 }
コード例 #4
0
ファイル: Observer.php プロジェクト: hyhoocchan/mage-local
 /**
  * Emulate 'account links' block with persistent data
  *
  * @param Mage_Core_Block_Abstract $block
  */
 public function emulateAccountLinks($block)
 {
     $this->_applyAccountLinksPersistentData();
     $block->getCacheKeyInfo();
     $block->addLink(Mage::helper('persistent')->getPersistentName(), Mage::helper('persistent')->getUnsetCookieUrl(), Mage::helper('persistent')->getPersistentName(), false, array(), 110);
     $block->removeLinkByUrl(Mage::helper('customer')->getRegisterUrl());
     $block->removeLinkByUrl(Mage::helper('customer')->getLoginUrl());
 }
コード例 #5
0
ファイル: Page.php プロジェクト: staywithabhi/porto
 /**
  * {@inheritdoc}
  */
 public function getCacheKeyInfo()
 {
     $info = parent::getCacheKeyInfo();
     $pageId = $this->getPageId();
     if ($pageId) {
         $info[] = 'CMSPAGE_' . $pageId;
     }
     return $info;
 }
コード例 #6
0
ファイル: Observer.php プロジェクト: relue/magento2
 /**
  * Emulate 'account links' block with persistent data
  *
  * @param Mage_Core_Block_Abstract $block
  */
 public function emulateAccountLinks($block)
 {
     $this->_applyAccountLinksPersistentData();
     $block->getCacheKeyInfo();
     $helper = Mage::helper('Mage_Persistent_Helper_Data');
     $block->addLink($helper->getPersistentName(), $helper->getUnsetCookieUrl(), $helper->getPersistentName(), false, array(), 110);
     $customerHelper = Mage::helper('Mage_Customer_Helper_Data');
     $block->removeLinkByUrl($customerHelper->getRegisterUrl());
     $block->removeLinkByUrl($customerHelper->getLoginUrl());
 }