Mage_Adminhtml_Block_Customer_Edit_Tab_View_Wishlist Class Reference

Inheritance diagram for Mage_Adminhtml_Block_Customer_Edit_Tab_View_Wishlist:

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 ()
 getHeadersVisibility ()
 getRowUrl ($row)

Protected Member Functions

 _prepareCollection ()
 _prepareColumns ()


Detailed Description

Definition at line 34 of file Wishlist.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 Wishlist.php.

00038     {
00039         parent::__construct();
00040         $this->setId('customer_view_wishlist_grid');
00041         $this->setSortable(false);
00042         $this->setPagerVisibility(false);
00043         $this->setFilterVisibility(false);
00044         $this->setEmptyText(Mage::helper('customer')->__("There are no items in customer's wishlist at the moment"));
00045     }


Member Function Documentation

_prepareCollection (  )  [protected]

Prepare grid collection object

Returns:
this

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 47 of file Wishlist.php.

00048     {
00049         $collection = Mage::getModel('wishlist/wishlist')->loadByCustomer(Mage::registry('current_customer'))
00050             ->getProductCollection()
00051             ->addAttributeToSelect('name')
00052             ->addStoreData();
00053 
00054         $this->setCollection($collection);
00055 
00056         return parent::_prepareCollection();
00057     }

_prepareColumns (  )  [protected]

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 59 of file Wishlist.php.

00060     {
00061         $this->addColumn('product_id', array(
00062             'header'    => Mage::helper('customer')->__('Product ID'),
00063             'index'     => 'product_id',
00064             'type'      => 'number',
00065             'width'     => '100px'
00066         ));
00067 
00068         $this->addColumn('product_name', array(
00069             'header'    => Mage::helper('customer')->__('Product Name'),
00070             'index'     => 'name'
00071         ));
00072 
00073         if (!Mage::app()->isSingleStoreMode()) {
00074             $this->addColumn('store', array(
00075                 'header'    => Mage::helper('customer')->__('Added From'),
00076                 'index'     => 'store_id',
00077                 'type'      => 'store',
00078                 'width'     => '160px',
00079             ));
00080         }
00081 
00082         $this->addColumn('added_at', array(
00083             'header'    => Mage::helper('customer')->__('Date Added'),
00084             'index'     => 'added_at',
00085             'type'      => 'date',
00086             'width'     => '140px',
00087         ));
00088 
00089         $this->addColumn('days', array(
00090             'header'    => Mage::helper('customer')->__('Days in Wishlist'),
00091             'index'     => 'days_in_wishlist',
00092             'type'      => 'number',
00093             'width'     => '140px',
00094         ));
00095 
00096         return parent::_prepareColumns();
00097     }

getHeadersVisibility (  ) 

Return visibility of column headers

Returns:
boolean

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 99 of file Wishlist.php.

00100     {
00101         return ($this->getCollection()->getSize() > 0);
00102     }

getRowUrl ( row  ) 

Definition at line 104 of file Wishlist.php.

00105     {
00106         return $this->getUrl('*/catalog_product/edit', array('id' => $row->getProductId()));
00107     }


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

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