Mage_Adminhtml_Block_Tag_Product_Grid Class Reference

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


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('tag_grid' . Mage::registry('tagId'));
00041         $this->setDefaultSort('name');
00042         $this->setDefaultDir('ASC');
00043     }


Member Function Documentation

_addColumnFilterToCollection ( column  )  [protected]

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 87 of file Grid.php.

00088     {
00089         if($column->getIndex() == 'popularity') {
00090             $this->getCollection()->addPopularityFilter($column->getFilter()->getCondition());
00091             return $this;
00092         } else {
00093             return parent::_addColumnFilterToCollection($column);
00094         }
00095     }

_afterLoadCollection (  )  [protected]

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 57 of file Grid.php.

00058     {
00059         return parent::_afterLoadCollection();
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         $tagId = Mage::registry('tagId');
00048         $collection = Mage::getModel('tag/tag')
00049             ->getEntityCollection()
00050             ->addTagFilter($tagId)
00051             ->addPopularity($tagId);
00052 
00053         $this->setCollection($collection);
00054         return parent::_prepareCollection();
00055     }

_prepareColumns (  )  [protected]

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 62 of file Grid.php.

00063     {
00064         $this->addColumn('product_id', array(
00065             'header'        => Mage::helper('tag')->__('ID'),
00066             'width'         => '50px',
00067             'align'         => 'right',
00068             'index'         => 'entity_id',
00069         ));
00070 
00071         $this->addColumn('name', array(
00072             'header'    => Mage::helper('tag')->__('Product Name'),
00073             'index'     => 'name',
00074         ));
00075 
00076         $this->addColumn('popularity', array(
00077             'header'        => Mage::helper('tag')->__('# of Uses'),
00078             'width'         => '50px',
00079             'align'         => 'right',
00080             'index'         => 'popularity',
00081             'type'          => 'number'
00082         ));
00083 
00084         return parent::_prepareColumns();
00085     }

getRowUrl ( row  )  [protected]

Definition at line 97 of file Grid.php.

00098     {
00099         return $this->getUrl('*/catalog_product/edit', array('id' => $row->getProductId()));
00100     }


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

Generated on Sat Jul 4 17:23:05 2009 for Magento by  doxygen 1.5.8