Public Member Functions | |
getCollection ($storeId) | |
Protected Member Functions | |
_construct () | |
_prepareObject (array $data) |
Definition at line 34 of file Page.php.
_construct | ( | ) | [protected] |
Init resource model (catalog/category)
Reimplemented from Mage_Core_Model_Resource_Abstract.
Definition at line 39 of file Page.php.
00040 { 00041 $this->_init('cms/page', 'page_id'); 00042 }
_prepareObject | ( | array $ | data | ) | [protected] |
Prepare page object
array | $data |
Definition at line 80 of file Page.php.
00081 { 00082 $object = new Varien_Object(); 00083 $object->setId($data[$this->getIdFieldName()]); 00084 $object->setUrl($data['url']); 00085 00086 return $object; 00087 }
getCollection | ( | $ | storeId | ) |
Retrieve cms page collection array
Definition at line 49 of file Page.php.
00050 { 00051 $pages = array(); 00052 00053 $select = $this->_getWriteAdapter()->select() 00054 ->from(array('main_table' => $this->getMainTable()), array($this->getIdFieldName(), 'identifier AS url')) 00055 ->join( 00056 array('store_table' => $this->getTable('cms/page_store')), 00057 'main_table.page_id=store_table.page_id', 00058 array() 00059 ) 00060 ->where('main_table.is_active=1') 00061 ->where('store_table.store_id IN(?)', array(0, $storeId)); 00062 $query = $this->_getWriteAdapter()->query($select); 00063 while ($row = $query->fetch()) { 00064 if ($row['url'] == Mage_Cms_Model_Page::NOROUTE_PAGE_ID) { 00065 continue; 00066 } 00067 $page = $this->_prepareObject($row); 00068 $pages[$page->getId()] = $page; 00069 } 00070 00071 return $pages; 00072 }