Mage_Adminhtml_Block_Report_Review_Product_Grid Class Reference

Inheritance diagram for Mage_Adminhtml_Block_Report_Review_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 ()
 getRowUrl ($row)

Protected Member Functions

 _prepareCollection ()
 _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('gridProducts');
00041         $this->setDefaultSort('review_cnt');
00042         $this->setDefaultDir('desc');
00043     }


Member Function Documentation

_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         $collection = Mage::getResourceModel('reports/review_product_collection')
00048             ->joinReview();
00049 
00050         $this->setCollection($collection);
00051 
00052         return parent::_prepareCollection();
00053     }

_prepareColumns (  )  [protected]

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 55 of file Grid.php.

00056     {
00057 
00058         $this->addColumn('entity_id', array(
00059             'header'    =>Mage::helper('reports')->__('ID'),
00060             'width'     =>'50px',
00061             'index'     =>'entity_id'
00062         ));
00063 
00064         $this->addColumn('name', array(
00065             'header'    => Mage::helper('reports')->__('Product Name'),
00066             'index'     => 'name'
00067         ));
00068 
00069         $this->addColumn('review_cnt', array(
00070             'header'    =>Mage::helper('reports')->__('Number of Reviews'),
00071             'width'     =>'50px',
00072             'align'     =>'right',
00073             'index'     =>'review_cnt'
00074         ));
00075 
00076         $this->addColumn('avg_rating', array(
00077             'header'    =>Mage::helper('reports')->__('Avg. rating'),
00078             'width'     =>'50px',
00079             'align'     =>'right',
00080             'index'     =>'avg_rating'
00081         ));
00082 
00083         $this->addColumn('avg_rating_approved', array(
00084             'header'    =>Mage::helper('reports')->__('Avg. approved rating'),
00085             'width'     =>'50px',
00086             'align'     =>'right',
00087             'index'     =>'avg_rating_approved'
00088         ));
00089 
00090         $this->addColumn('last_created', array(
00091             'header'    =>Mage::helper('reports')->__('Last Review'),
00092             'width'     =>'150px',
00093             'index'     =>'last_created',
00094             'type'      =>'datetime'
00095         ));
00096 
00097         $this->addColumn('action', array(
00098             'header'    => Mage::helper('reports')->__('Action'),
00099             'width'     => '100px',
00100             'align'     => 'center',
00101             'filter'    => false,
00102             'sortable'  => false,
00103             'renderer'  => 'adminhtml/report_grid_column_renderer_product'
00104         ));
00105 
00106         $this->setFilterVisibility(false);
00107 
00108         $this->addExportType('*/*/exportProductCsv', Mage::helper('reports')->__('CSV'));
00109         $this->addExportType('*/*/exportProductExcel', Mage::helper('reports')->__('Excel'));
00110 
00111         return parent::_prepareColumns();
00112     }

getRowUrl ( row  ) 

Definition at line 114 of file Grid.php.

00115     {
00116         return $this->getUrl('*/catalog_product_review/', array('productId' => $row->getId()));
00117     }


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

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