Public Member Functions | |
__construct () | |
Protected Member Functions | |
_prepareCollection () | |
_prepareColumns () |
Definition at line 34 of file Grid.php.
__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('reviews_grid'); 00041 }
_prepareCollection | ( | ) | [protected] |
Prepare grid collection object
Reimplemented from Mage_Adminhtml_Block_Widget_Grid.
Definition at line 43 of file Grid.php.
00044 { 00045 00046 //$collection = Mage::getModel('review/review')->getProductCollection(); 00047 00048 //$collection->getSelect() 00049 // ->where('rt.entity_pk_value='.(int)$this->getRequest()->getParam('id')); 00050 00051 //$collection->getEntity()->setStore(0); 00052 00053 $collection = Mage::getResourceModel('reports/review_collection') 00054 ->addProductFilter((int)$this->getRequest()->getParam('id')); 00055 00056 $this->setCollection($collection); 00057 00058 parent::_prepareCollection(); 00059 00060 return $this; 00061 }
_prepareColumns | ( | ) | [protected] |
Reimplemented from Mage_Adminhtml_Block_Widget_Grid.
Definition at line 63 of file Grid.php.
00064 { 00065 00066 $this->addColumn('nickname', array( 00067 'header' =>Mage::helper('reports')->__('Customer'), 00068 'width' =>'100px', 00069 'index' =>'nickname' 00070 )); 00071 00072 $this->addColumn('title', array( 00073 'header' =>Mage::helper('reports')->__('Title'), 00074 'width' =>'150px', 00075 'index' =>'title' 00076 )); 00077 00078 $this->addColumn('detail', array( 00079 'header' =>Mage::helper('reports')->__('Detail'), 00080 'index' =>'detail' 00081 )); 00082 00083 $this->addColumn('created_at', array( 00084 'header' =>Mage::helper('reports')->__('Created at'), 00085 'index' =>'created_at', 00086 'width' =>'200px', 00087 'type' =>'datetime' 00088 )); 00089 00090 $this->setFilterVisibility(false); 00091 00092 $this->addExportType('*/*/exportProductDetailCsv', Mage::helper('reports')->__('CSV')); 00093 $this->addExportType('*/*/exportProductDetailExcel', Mage::helper('reports')->__('Excel')); 00094 00095 return parent::_prepareColumns(); 00096 }