Public Member Functions | |
fetchUpdatesByHandle ($handle, $params=array()) | |
Protected Member Functions | |
_construct () |
Definition at line 28 of file Layout.php.
_construct | ( | ) | [protected] |
Resource initialization
Reimplemented from Mage_Core_Model_Resource_Abstract.
Definition at line 30 of file Layout.php.
00031 { 00032 $this->_init('core/layout_update', 'layout_update_id'); 00033 }
fetchUpdatesByHandle | ( | $ | handle, | |
$ | params = array() | |||
) |
Retrieve layout updates by handle
string | $handle | |
array | $params |
Definition at line 41 of file Layout.php.
00042 { 00043 $storeId = isset($params['store_id']) ? $params['store_id'] : Mage::app()->getStore()->getId(); 00044 $package = isset($params['package']) ? $params['package'] : Mage::getSingleton('core/design_package')->getPackageName(); 00045 $theme = isset($params['theme']) ? $params['theme'] : Mage::getSingleton('core/design_package')->getTheme('layout'); 00046 00047 $read = $this->_getReadAdapter(); 00048 $updateStr = ''; 00049 00050 if ($read) { 00051 $select = $read->select()->from(array('update'=>$this->getMainTable()), 'xml') 00052 ->join(array('link'=>$this->getTable('core/layout_link')), 'link.layout_update_id=update.layout_update_id', '') 00053 ->where('link.store_id=?', $storeId) 00054 ->where('link.package=?', $package) 00055 ->where('link.theme=?', $theme); 00056 00057 if ($updates = $read->fetchAll($select)) { 00058 foreach ($updates as $update) { 00059 $updateStr .= $update['xml']; 00060 } 00061 } 00062 } 00063 return $updateStr; 00064 }