Mage_Adminhtml_Block_Report_Product_Grid Class Reference

Inheritance diagram for Mage_Adminhtml_Block_Report_Product_Grid:

Mage_Adminhtml_Block_Widget_Grid Mage_Adminhtml_Block_Widget Mage_Adminhtml_Block_Template Mage_Core_Block_Template Mage_Core_Block_Abstract Varien_Object

List of all members.

Public Member Functions

 __construct ()

Protected Member Functions

 _prepareCollection ()
 _afterLoadCollection ()
 _prepareColumns ()


Detailed Description

Definition at line 34 of file Grid.php.


Constructor & Destructor Documentation

__construct (  ) 

Constructor

By default is looking for first argument as array and assignes it as object attributes This behaviour may change in child classes

Reimplemented from Varien_Object.

Definition at line 37 of file Grid.php.

00038     {
00039         parent::__construct();
00040         $this->setId('productsReportGrid');
00041         $this->setDefaultSort('entity_id');
00042         $this->setDefaultDir('desc');
00043     }


Member Function Documentation

_afterLoadCollection (  )  [protected]

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 56 of file Grid.php.

00057     {
00058         $totalObj = new Mage_Reports_Model_Totals();
00059         $this->setTotals($totalObj->countTotals($this));
00060     }

_prepareCollection (  )  [protected]

Prepare grid collection object

Returns:
this

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 45 of file Grid.php.

00046     {
00047 
00048         $collection = Mage::getResourceModel('reports/product_collection');
00049         $collection->getEntity()->setStore(0);
00050 
00051         $this->setCollection($collection);
00052 
00053         return parent::_prepareCollection();
00054     }

_prepareColumns (  )  [protected]

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 62 of file Grid.php.

00063     {
00064         $this->addColumn('entity_id', array(
00065             'header'    =>Mage::helper('reports')->__('ID'),
00066             'width'     =>'50px',
00067             'index'     =>'entity_id',
00068             'total'     =>'Total'
00069         ));
00070 
00071         $this->addColumn('name', array(
00072             'header'    =>Mage::helper('reports')->__('Name'),
00073             'index'     =>'name'
00074         ));
00075 
00076         $this->addColumn('viewed', array(
00077             'header'    =>Mage::helper('reports')->__('Number Viewed'),
00078             'width'     =>'50px',
00079             'align'     =>'right',
00080             'index'     =>'viewed',
00081             'total'     =>'sum'
00082         ));
00083 
00084         $this->addColumn('added', array(
00085             'header'    =>Mage::helper('reports')->__('Number Added'),
00086             'width'     =>'50px',
00087             'align'     =>'right',
00088             'index'     =>'added',
00089             'total'     =>'sum'
00090         ));
00091 
00092         $this->addColumn('purchased', array(
00093             'header'    =>Mage::helper('reports')->__('Number Purchased'),
00094             'width'     =>'50px',
00095             'align'     =>'right',
00096             'index'     =>'purchased',
00097             'total'     =>'sum'
00098         ));
00099 
00100         $this->addColumn('fulfilled', array(
00101             'header'    =>Mage::helper('reports')->__('Number Fulfilled'),
00102             'width'     =>'50px',
00103             'align'     =>'right',
00104             'index'     =>'fulfilled',
00105             'total'     =>'sum'
00106         ));
00107 
00108         $this->addColumn('revenue', array(
00109             'header'    =>Mage::helper('reports')->__('Revenue'),
00110             'width'     =>'50px',
00111             'align'     =>'right',
00112             'index'     =>'revenue',
00113             'total'     =>'sum'
00114         ));
00115 
00116         $this->setCountTotals(true);
00117 
00118         $this->addExportType('*/*/exportProductsCsv', Mage::helper('reports')->__('CSV'));
00119         $this->addExportType('*/*/exportProductsExcel', Mage::helper('reports')->__('Excel'));
00120 
00121         return parent::_prepareColumns();
00122     }


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

Generated on Sat Jul 4 17:22:55 2009 for Magento by  doxygen 1.5.8