Mage_Tag_Block_Product_Result Class Reference

Inheritance diagram for Mage_Tag_Block_Product_Result:

Mage_Catalog_Block_Product_Abstract Mage_Core_Block_Template Mage_Core_Block_Abstract Varien_Object

List of all members.

Public Member Functions

 getTag ()
 setListOrders ()
 setListModes ()
 setListCollection ()
 getProductListHtml ()
 getResultCount ()
 getHeaderText ()
 getSubheaderText ()
 getNoResultText ()

Protected Member Functions

 _prepareLayout ()
 _getProductCollection ()

Protected Attributes

 $_productCollection


Detailed Description

Definition at line 35 of file Result.php.


Member Function Documentation

_getProductCollection (  )  [protected]

Definition at line 79 of file Result.php.

00080     {
00081         if(is_null($this->_productCollection)) {
00082             $tagModel = Mage::getModel('tag/tag');
00083             $this->_productCollection = $tagModel->getEntityCollection()
00084                 ->addAttributeToSelect(Mage::getSingleton('catalog/config')->getProductAttributes())
00085                 ->addTagFilter($this->getTag()->getId())
00086                 ->addStoreFilter()
00087                 ->addMinimalPrice()
00088                 ->addUrlRewrite();
00089             Mage::getSingleton('catalog/product_status')->addSaleableFilterToCollection($this->_productCollection);
00090             Mage::getSingleton('catalog/product_visibility')->addVisibleInSiteFilterToCollection($this->_productCollection);
00091         }
00092 
00093         return $this->_productCollection;
00094     }

_prepareLayout (  )  [protected]

Preparing global layout

You can redefine this method in child classes for changin layout

Returns:
Mage_Core_Block_Abstract

Reimplemented from Mage_Core_Block_Abstract.

Definition at line 45 of file Result.php.

00046     {
00047         $title = $this->getHeaderText();
00048         $this->getLayout()->getBlock('head')->setTitle($title);
00049         $this->getLayout()->getBlock('root')->setHeaderTitle($title);
00050         return parent::_prepareLayout();
00051     }

getHeaderText (  ) 

Definition at line 105 of file Result.php.

00106     {
00107         if( $this->getTag()->getName() ) {
00108             return Mage::helper('tag')->__("Products tagged with '%s'", $this->htmlEscape($this->getTag()->getName()));
00109         } else {
00110             return false;
00111         }
00112     }

getNoResultText (  ) 

Definition at line 119 of file Result.php.

00120     {
00121         return Mage::helper('tag')->__('No matches found.');
00122     }

getProductListHtml (  ) 

Definition at line 74 of file Result.php.

00075     {
00076         return $this->getChildHtml('search_result_list');
00077     }

getResultCount (  ) 

Definition at line 96 of file Result.php.

00097     {
00098         if (!$this->getData('result_count')) {
00099             $size = $this->_getProductCollection()->getSize();
00100             $this->setResultCount($size);
00101         }
00102         return $this->getData('result_count');
00103     }

getSubheaderText (  ) 

Definition at line 114 of file Result.php.

00115     {
00116         return false;
00117     }

getTag (  ) 

Definition at line 40 of file Result.php.

00041     {
00042         return Mage::registry('current_tag');
00043     }

setListCollection (  ) 

Definition at line 69 of file Result.php.

00069                                         {
00070         $this->getChild('search_result_list')
00071            ->setCollection($this->_getProductCollection());
00072     }

setListModes (  ) 

Definition at line 61 of file Result.php.

00061                                    {
00062         $this->getChild('search_result_list')
00063             ->setModes(array(
00064                 'grid' => Mage::helper('tag')->__('Grid'),
00065                 'list' => Mage::helper('tag')->__('List'))
00066             );
00067     }

setListOrders (  ) 

Definition at line 53 of file Result.php.

00053                                     {
00054         $this->getChild('search_result_list')
00055             ->setAvailableOrders(array(
00056                 'name' => Mage::helper('tag')->__('Name'),
00057                 'price'=>Mage::helper('tag')->__('Price'))
00058             );
00059     }


Member Data Documentation

$_productCollection [protected]

Definition at line 37 of file Result.php.


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

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