Mage_Adminhtml_Block_Tag_Customer_Grid Class Reference

Inheritance diagram for Mage_Adminhtml_Block_Tag_Customer_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 ()
 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

_afterLoadCollection (  )  [protected]

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 58 of file Grid.php.

00059     {
00060         $this->getCollection()->addProductName();
00061         return parent::_afterLoadCollection();
00062     }

_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             ->getCustomerCollection()
00050             ->addTagFilter($tagId)
00051             ->setCountAttribute('tr.tag_relation_id')
00052             ->addGroupByCustomerProduct();
00053 
00054         $this->setCollection($collection);
00055         return parent::_prepareCollection();
00056     }

_prepareColumns (  )  [protected]

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 64 of file Grid.php.

00065     {
00066         $this->addColumn('customer_id', array(
00067             'header'        => Mage::helper('tag')->__('ID'),
00068             'width'         => '50px',
00069             'align'         => 'right',
00070             'index'         => 'entity_id',
00071         ));
00072 
00073         $this->addColumn('firstname', array(
00074             'header'    => Mage::helper('tag')->__('First Name'),
00075             'index'     => 'firstname',
00076         ));
00077 
00078         $this->addColumn('lastname', array(
00079             'header'    => Mage::helper('tag')->__('Last Name'),
00080             'index'     => 'lastname',
00081         ));
00082 
00083         if (!Mage::app()->isSingleStoreMode()) {
00084             $this->addColumn('store_id', array(
00085                 'header'    => Mage::helper('tag')->__('Tagged in'),
00086                 'index'     => 'store_id',
00087                 'type'      => 'store',
00088                 'store_view' => true,
00089             ));
00090         }
00091 
00092         $this->addColumn('product', array(
00093             'header'    => Mage::helper('tag')->__('Product Name'),
00094             'filter'    => false,
00095             'sortable'  => false,
00096             'index'     => 'product',
00097         ));
00098 
00099         $this->addColumn('product_sku', array(
00100             'header'    => Mage::helper('tag')->__('Product SKU'),
00101             'filter'    => false,
00102             'sortable'  => false,
00103             'width'     => '50px',
00104             'align'     => 'right',
00105             'index'     => 'product_sku',
00106         ));
00107 
00108         $this->addColumn('product_sku', array(
00109             'header'    => Mage::helper('tag')->__('Product SKU'),
00110             'filter'    => false,
00111             'sortable'  => false,
00112             'width'     => '50px',
00113             'align'     => 'right',
00114             'index'     => 'product_sku',
00115         ));
00116 
00117         return parent::_prepareColumns();
00118     }

getRowUrl ( row  )  [protected]

Definition at line 120 of file Grid.php.

00121     {
00122         return $this->getUrl('*/customer/edit', array('id' => $row->getCustomerId()));
00123     }


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