Mage_CatalogSearch_Model_Mysql4_Fulltext_Collection Class Reference

Inheritance diagram for Mage_CatalogSearch_Model_Mysql4_Fulltext_Collection:

Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection Mage_Catalog_Model_Resource_Eav_Mysql4_Collection_Abstract Mage_Eav_Model_Entity_Collection_Abstract Varien_Data_Collection_Db Varien_Data_Collection

List of all members.

Public Member Functions

 addSearchFilter ($query)
 setOrder ($attribute, $dir='desc')

Protected Member Functions

 _getQuery ()


Detailed Description

Definition at line 28 of file Collection.php.


Member Function Documentation

_getQuery (  )  [protected]

Retrieve query model object

Returns:
Mage_CatalogSearch_Model_Query

Definition at line 36 of file Collection.php.

00037     {
00038         return Mage::helper('catalogSearch')->getQuery();
00039     }

addSearchFilter ( query  ) 

Add search query filter

Parameters:
Mage_CatalogSearch_Model_Query $query
Returns:
Mage_CatalogSearch_Model_Mysql4_Search_Collection

Definition at line 47 of file Collection.php.

00048     {
00049         Mage::getSingleton('catalogsearch/fulltext')->prepareResult();
00050 
00051         $this->getSelect()->joinInner(
00052             array('search_result' => $this->getTable('catalogsearch/result')),
00053             $this->getConnection()->quoteInto(
00054                 'search_result.product_id=e.entity_id AND search_result.query_id=?',
00055                 $this->_getQuery()->getId()
00056             ),
00057             array('relevance' => 'relevance')
00058         );
00059 
00060         return $this;
00061     }

setOrder ( attribute,
dir = 'desc' 
)

Set Order field

Parameters:
string $attribute
string $dir
Returns:
Mage_CatalogSearch_Model_Mysql4_Fulltext_Collection

Reimplemented from Mage_Eav_Model_Entity_Collection_Abstract.

Definition at line 70 of file Collection.php.

00071     {
00072         if ($attribute == 'relevance') {
00073             $this->getSelect()->order("relevance {$dir}");
00074         }
00075         else {
00076             parent::setOrder($attribute, $dir);
00077         }
00078         return $this;
00079     }


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