Mage_CatalogSearch_Model_Layer Class Reference

Inheritance diagram for Mage_CatalogSearch_Model_Layer:

Mage_Catalog_Model_Layer Varien_Object

List of all members.

Public Member Functions

 getProductCollection ()
 prepareProductCollection ($collection)
 getStateKey ()
 getStateTags (array $additionalTags=array())

Public Attributes

const XML_PATH_DISPLAY_LAYER_COUNT = 'catalog/search/use_layered_navigation_count'

Protected Member Functions

 _prepareAttributeCollection ($collection)
 _prepareAttribute ($attribute)


Detailed Description

Definition at line 27 of file Layer.php.


Member Function Documentation

_prepareAttribute ( attribute  )  [protected]

Prepare attribute for use in layered navigation

Parameters:
Mage_Eav_Model_Entity_Attribute $attribute
Returns:
Mage_Eav_Model_Entity_Attribute

Reimplemented from Mage_Catalog_Model_Layer.

Definition at line 117 of file Layer.php.

_prepareAttributeCollection ( collection  )  [protected]

Add filters to attribute collection

Parameters:
Mage_Eav_Model_Mysql4_Entity_Attribute_Collection $collection
Returns:
Mage_Eav_Model_Mysql4_Entity_Attribute_Collection

Reimplemented from Mage_Catalog_Model_Layer.

Definition at line 105 of file Layer.php.

00106     {
00107         $collection->addIsFilterableInSearchFilter();
00108         return $collection;
00109     }

getProductCollection (  ) 

Get current layer product collection

Returns:
Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection

Reimplemented from Mage_Catalog_Model_Layer.

Definition at line 36 of file Layer.php.

00037     {
00038         if (isset($this->_productCollections[$this->getCurrentCategory()->getId()])) {
00039             $collection = $this->_productCollections[$this->getCurrentCategory()->getId()];
00040         }
00041         else {
00042             $collection = Mage::getResourceModel('catalogsearch/fulltext_collection');
00043             $this->prepareProductCollection($collection);
00044             $this->_productCollections[$this->getCurrentCategory()->getId()] = $collection;
00045         }
00046 
00047         return $collection;
00048     }

getStateKey (  ) 

Get layer state key

Returns:
string

Reimplemented from Mage_Catalog_Model_Layer.

Definition at line 77 of file Layer.php.

00078     {
00079         if ($this->_stateKey === null) {
00080             $this->_stateKey = 'Q_'.Mage::helper('catalogSearch')->getQuery()->getId()
00081                 .'_'.parent::getStateKey();
00082         }
00083         return $this->_stateKey;
00084     }

getStateTags ( array additionalTags = array()  ) 

Get default tags for current layer state

Parameters:
array $additionalTags
Returns:
array

Reimplemented from Mage_Catalog_Model_Layer.

Definition at line 92 of file Layer.php.

00093     {
00094         $additionalTags = parent::getStateTags($additionalTags);
00095         $additionalTags[] = Mage_CatalogSearch_Model_Query::CACHE_TAG;
00096         return $additionalTags;
00097     }

prepareProductCollection ( collection  ) 

Prepare product collection

Parameters:
Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection $collection
Returns:
Mage_Catalog_Model_Layer

Reimplemented from Mage_Catalog_Model_Layer.

Definition at line 56 of file Layer.php.

00057     {
00058         $collection->addAttributeToSelect(Mage::getSingleton('catalog/config')->getProductAttributes())
00059             ->addSearchFilter(Mage::helper('catalogSearch')->getEscapedQueryText())
00060             ->setStore(Mage::app()->getStore())
00061             ->addMinimalPrice()
00062             ->addFinalPrice()
00063             ->addTaxPercents()
00064             ->addStoreFilter()
00065             ->addUrlRewrite();
00066 
00067         Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($collection);
00068         Mage::getSingleton('catalog/product_visibility')->addVisibleInSearchFilterToCollection($collection);
00069         return $this;
00070     }


Member Data Documentation

const XML_PATH_DISPLAY_LAYER_COUNT = 'catalog/search/use_layered_navigation_count'

Definition at line 29 of file Layer.php.


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

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