Mage_Review_Block_Helper Class Reference

Inheritance diagram for Mage_Review_Block_Helper:

Mage_Core_Block_Template Mage_Core_Block_Abstract Varien_Object

List of all members.

Public Member Functions

 getSummaryHtml ($product, $templateType, $displayIfNoReviews)
 getRatingSummary ()
 getReviewsCount ()
 getReviewsUrl ()
 addTemplate ($type, $template)


Detailed Description

Definition at line 34 of file Helper.php.


Member Function Documentation

addTemplate ( type,
template 
)

Add an available template by type

It should be called before getSummaryHtml()

Parameters:
string $type
string $template

Definition at line 86 of file Helper.php.

00087     {
00088         $this->_availableTemplates[$type] = $template;
00089     }

getRatingSummary (  ) 

Definition at line 60 of file Helper.php.

00061     {
00062         return $this->getProduct()->getRatingSummary()->getRatingSummary();
00063     }

getReviewsCount (  ) 

Definition at line 65 of file Helper.php.

00066     {
00067         return $this->getProduct()->getRatingSummary()->getReviewsCount();
00068     }

getReviewsUrl (  ) 

Definition at line 70 of file Helper.php.

00071     {
00072         return Mage::getUrl('review/product/list', array(
00073            'id'        => $this->getProduct()->getId(),
00074            'category'  => $this->getProduct()->getCategoryId()
00075         ));
00076     }

getSummaryHtml ( product,
templateType,
displayIfNoReviews 
)

Definition at line 41 of file Helper.php.

00042     {
00043         // pick template among available
00044         if (empty($this->_availableTemplates[$templateType])) {
00045             $templateType = 'default';
00046         }
00047         $this->setTemplate($this->_availableTemplates[$templateType]);
00048 
00049         $this->setDisplayIfEmpty($displayIfNoReviews);
00050 
00051         if (!$product->getRatingSummary()) {
00052             Mage::getModel('review/review')
00053                ->getEntitySummary($product, Mage::app()->getStore()->getId());
00054         }
00055         $this->setProduct($product);
00056 
00057         return $this->toHtml();
00058     }


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

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