Public Member Functions | |
addSearchFilter ($query) | |
setOrder ($attribute, $dir='desc') | |
Protected Member Functions | |
_getQuery () |
Definition at line 28 of file Collection.php.
_getQuery | ( | ) | [protected] |
Retrieve query model object
Definition at line 36 of file Collection.php.
00037 { 00038 return Mage::helper('catalogSearch')->getQuery(); 00039 }
addSearchFilter | ( | $ | query | ) |
Add search query filter
Mage_CatalogSearch_Model_Query | $query |
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
string | $attribute | |
string | $dir |
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 }