Mage_Catalog_Block_Product_List_Random Class Reference

Inheritance diagram for Mage_Catalog_Block_Product_List_Random:

Mage_Catalog_Block_Product_List Mage_Catalog_Block_Product_Abstract Mage_Core_Block_Template Mage_Core_Block_Abstract Varien_Object

List of all members.

Protected Member Functions

 _getProductCollection ()


Detailed Description

Definition at line 35 of file Random.php.


Member Function Documentation

_getProductCollection (  )  [protected]

Retrieve loaded category collection

Returns:
Mage_Eav_Model_Entity_Collection_Abstract

Reimplemented from Mage_Catalog_Block_Product_List.

Definition at line 37 of file Random.php.

00038     {
00039         if (is_null($this->_productCollection)) {
00040             $collection = Mage::getResourceModel('catalog/product_collection');
00041             Mage::getModel('catalog/layer')->prepareProductCollection($collection);
00042             $collection->getSelect()->order('rand()');
00043             $collection->addStoreFilter();
00044             $numProducts = $this->getNumProducts() ? $this->getNumProducts() : 3;
00045             $collection->setPage(1, $numProducts);
00046 
00047             $this->_productCollection = $collection;
00048         }
00049         return $this->_productCollection;
00050     }


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

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