Public Member Functions | |
addItemCountExpr () | |
Protected Member Functions | |
_construct () |
Definition at line 35 of file Collection.php.
_construct | ( | ) | [protected] |
Initialize collection
Reimplemented from Mage_Eav_Model_Entity_Collection_Abstract.
Reimplemented in Mage_Reports_Model_Mysql4_Tax_Collection.
Definition at line 37 of file Collection.php.
00038 { 00039 $this->_init('sales/order'); 00040 }
addItemCountExpr | ( | ) |
Reimplemented in Mage_Reports_Model_Mysql4_Order_Collection.
Definition at line 42 of file Collection.php.
00043 { 00044 $orderTable = $this->getEntity()->getEntityTable(); 00045 $orderItemEntityTypeId = Mage::getResourceSingleton('sales/order_item')->getTypeId(); 00046 $this->getSelect()->join( 00047 array('items'=>$orderTable), 00048 'items.parent_id=e.entity_id and items.entity_type_id='.$orderItemEntityTypeId, 00049 array('items_count'=>new Zend_Db_Expr('COUNT(items.entity_id)')) 00050 ) 00051 ->group('e.entity_id'); 00052 return $this; 00053 }