Mage_Tag_Block_Customer_View Class Reference

Inheritance diagram for Mage_Tag_Block_Customer_View:

Mage_Catalog_Block_Product_Abstract Mage_Core_Block_Template Mage_Core_Block_Abstract Varien_Object

List of all members.

Public Member Functions

 getTagInfo ()
 getMyProducts ()
 getCount ()
 getReviewUrl ($productId)
 getToolbarHtml ()
 getMode ()

Protected Member Functions

 _construct ()
 _prepareLayout ()
 _getCollection ()

Protected Attributes

 $_collection
 $_tagInfo


Detailed Description

Definition at line 35 of file View.php.


Member Function Documentation

_construct (  )  [protected]

Initialize block

Reimplemented from Mage_Core_Block_Abstract.

Definition at line 55 of file View.php.

00056     {
00057         parent::_construct();
00058         $this->setTagId(Mage::registry('tagId'));
00059     }

_getCollection (  )  [protected]

Retrieve Tagged product(s) collection

Returns:
Mage_Tag_Model_Mysql4_Product_Collection

Definition at line 146 of file View.php.

00147     {
00148         if (is_null($this->_collection)) {
00149             $this->_collection = Mage::getModel('tag/tag')
00150                 ->getEntityCollection()
00151                 ->addTagFilter($this->getTagId())
00152                 ->addCustomerFilter(Mage::getSingleton('customer/session')->getCustomerId())
00153                 ->addStoreFilter(Mage::app()->getStore()->getId())
00154                 ->addAttributeToSelect(Mage::getSingleton('catalog/config')->getProductAttributes())
00155                 ->setActiveFilter();
00156 
00157             Mage::getSingleton('catalog/product_status')
00158                 ->addVisibleFilterToCollection($this->_collection);
00159             Mage::getSingleton('catalog/product_visibility')
00160                 ->addVisibleInSiteFilterToCollection($this->_collection);
00161         }
00162         return $this->_collection;
00163     }

_prepareLayout (  )  [protected]

Preparing block layout

Returns:
Mage_Tag_Block_Customer_View

Reimplemented from Mage_Core_Block_Abstract.

Definition at line 111 of file View.php.

00112     {
00113         $toolbar = $this->getLayout()
00114             ->createBlock('page/html_pager', 'customer_tag_list.toolbar')
00115             ->setCollection($this->_getCollection());
00116 
00117         $this->setChild('toolbar', $toolbar);
00118         return parent::_prepareLayout();
00119     }

getCount (  ) 

Retrieve count of Tagged Product(s)

Returns:
int

Definition at line 90 of file View.php.

00091     {
00092         return sizeof($this->getMyProducts());
00093     }

getMode (  ) 

Retrieve Current Mode

Returns:
string

Definition at line 136 of file View.php.

00137     {
00138         return $this->getChild('toolbar')->getCurrentMode();
00139     }

getMyProducts (  ) 

Retrieve Tagged Product Collection items

Returns:
array

Definition at line 80 of file View.php.

00081     {
00082         return $this->_getCollection()->getItems();
00083     }

getReviewUrl ( productId  ) 

Retrieve Product Info URL

Parameters:
int $productId
Returns:
string

Definition at line 101 of file View.php.

00102     {
00103         return Mage::getUrl('review/product/list', array('id' => $productId));
00104     }

getTagInfo (  ) 

Retrieve current Tag object

Returns:
Mage_Tag_Model_Tag

Definition at line 66 of file View.php.

00067     {
00068         if (is_null($this->_tagInfo)) {
00069             $this->_tagInfo = Mage::getModel('tag/tag')
00070                 ->load($this->getTagId());
00071         }
00072         return $this->_tagInfo;
00073     }

getToolbarHtml (  ) 

Retrieve Toolbar block HTML

Returns:
string

Definition at line 126 of file View.php.

00127     {
00128         return $this->getChildHtml('toolbar');
00129     }


Member Data Documentation

$_collection [protected]

Definition at line 42 of file View.php.

$_tagInfo [protected]

Definition at line 49 of file View.php.


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

Generated on Sat Jul 4 17:24:52 2009 for Magento by  doxygen 1.5.8