Public Member Functions | |
addTagedCount () | |
getSelectCountSql () | |
setOrder ($attribute, $dir='desc') |
Definition at line 35 of file Collection.php.
addTagedCount | ( | ) |
Definition at line 38 of file Collection.php.
00039 { 00040 $this->getSelect() 00041 ->from('', array('taged' => 'count(tr.tag_relation_id)')); 00042 //->order('taged desc'); 00043 return $this; 00044 }
getSelectCountSql | ( | ) |
Get SQL for get record count
Reimplemented from Mage_Tag_Model_Mysql4_Customer_Collection.
Definition at line 46 of file Collection.php.
00047 { 00048 $countSelect = clone $this->getSelect(); 00049 $countSelect->reset(Zend_Db_Select::ORDER); 00050 $countSelect->reset(Zend_Db_Select::GROUP); 00051 $countSelect->reset(Zend_Db_Select::LIMIT_COUNT); 00052 $countSelect->reset(Zend_Db_Select::LIMIT_OFFSET); 00053 00054 $sql = $countSelect->__toString(); 00055 00056 $sql = preg_replace('/^select\s+.+?\s+from\s+/is', 'select count(DISTINCT tr.customer_id) from ', $sql); 00057 00058 return $sql; 00059 }
setOrder | ( | $ | attribute, | |
$ | dir = 'desc' | |||
) |
Set sorting order
$attribute can also be an array of attributes
string|array | $attribute | |
string | $dir |
Reimplemented from Mage_Tag_Model_Mysql4_Customer_Collection.
Definition at line 61 of file Collection.php.
00062 { 00063 switch( $attribute ) { 00064 case 'taged': 00065 $this->getSelect()->order($attribute . ' ' . $dir); 00066 break; 00067 00068 default: 00069 parent::setOrder($attribute, $dir); 00070 } 00071 return $this; 00072 }