Mage_Core_Model_Mysql4_Layout Class Reference

Inheritance diagram for Mage_Core_Model_Mysql4_Layout:

Mage_Core_Model_Mysql4_Abstract Mage_Core_Model_Resource_Abstract

List of all members.

Public Member Functions

 fetchUpdatesByHandle ($handle, $params=array())

Protected Member Functions

 _construct ()


Detailed Description

Definition at line 28 of file Layout.php.


Member Function Documentation

_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

Parameters:
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     }


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:23:59 2009 for Magento by  doxygen 1.5.8