Mage_Sitemap_Model_Mysql4_Cms_Page Class Reference

Inheritance diagram for Mage_Sitemap_Model_Mysql4_Cms_Page:

Mage_Core_Model_Mysql4_Abstract Mage_Core_Model_Resource_Abstract

List of all members.

Public Member Functions

 getCollection ($storeId)

Protected Member Functions

 _construct ()
 _prepareObject (array $data)


Detailed Description

Definition at line 34 of file Page.php.


Member Function Documentation

_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

Parameters:
array $data
Returns:
Varien_Object

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

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


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

Generated on Sat Jul 4 17:24:52 2009 for Magento by  doxygen 1.5.8