Mage_Reports_Model_Mysql4_Shipping_Collection Class Reference

Inheritance diagram for Mage_Reports_Model_Mysql4_Shipping_Collection:

Mage_Sales_Model_Entity_Order_Collection Mage_Eav_Model_Entity_Collection_Abstract Varien_Data_Collection_Db Varien_Data_Collection

List of all members.

Public Member Functions

 setDateRange ($from, $to)
 setStoreIds ($storeIds)


Detailed Description

Definition at line 35 of file Collection.php.


Member Function Documentation

setDateRange ( from,
to 
)

Definition at line 38 of file Collection.php.

00039     {
00040         $this->_reset()
00041             ->addAttributeToSelect('*')
00042             ->addAttributeToFilter('created_at', array('from' => $from, 'to' => $to))
00043             ->addExpressionAttributeToSelect('orders', 'COUNT(DISTINCT({{entity_id}}))', array('entity_id'))
00044             ->addAttributeToSelect('shipping_description')
00045             ->groupByAttribute('shipping_description')
00046             ->getSelect()->order('orders desc');
00047 
00048         $this->getSelect()->where("`_table_shipping_description`.`value` <> ''");
00049         return $this;
00050     }

setStoreIds ( storeIds  ) 

Definition at line 52 of file Collection.php.

00053     {
00054         $vals = array_values($storeIds);
00055         if (count($storeIds) >= 1 && $vals[0] != '') {
00056             $this->addAttributeToFilter('store_id', array('in' => (array)$storeIds));
00057             $this->addExpressionAttributeToSelect('total',
00058                 'SUM({{base_shipping_amount}})',
00059                 array('base_shipping_amount'));
00060         } else {
00061             $this->addExpressionAttributeToSelect('total',
00062                 'SUM({{base_shipping_amount}}*{{base_to_global_rate}})',
00063                 array('base_shipping_amount', 'base_to_global_rate'));
00064         }
00065 
00066         return $this;
00067     }


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