Mage_Reports_Model_Mysql4_Tag_Customer_Collection Class Reference

Inheritance diagram for Mage_Reports_Model_Mysql4_Tag_Customer_Collection:

Mage_Tag_Model_Mysql4_Customer_Collection Mage_Customer_Model_Entity_Customer_Collection Mage_Eav_Model_Entity_Collection_Abstract Varien_Data_Collection_Db Varien_Data_Collection

List of all members.

Public Member Functions

 addTagedCount ()
 getSelectCountSql ()
 setOrder ($attribute, $dir='desc')


Detailed Description

Definition at line 35 of file Collection.php.


Member Function Documentation

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

Returns:
Varien_Db_Select

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

Parameters:
string|array $attribute
string $dir
Returns:
Mage_Eav_Model_Entity_Collection_Abstract

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     }


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

Generated on Sat Jul 4 17:24:37 2009 for Magento by  doxygen 1.5.8