Mage_Review_Block_Customer_View Class Reference

Inheritance diagram for Mage_Review_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

 __construct ()
 getProductData ()
 getReviewData ()
 getBackUrl ()
 getRating ()
 getRatingSummary ()
 getTotalReviews ()
 dateFormat ($date)


Detailed Description

Definition at line 35 of file View.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 View.php.

00038     {
00039         parent::__construct();
00040         $this->setTemplate('review/customer/view.phtml');
00041 
00042         $this->setReviewId($this->getRequest()->getParam('id', false));
00043     }


Member Function Documentation

dateFormat ( date  ) 

Definition at line 101 of file View.php.

00102     {
00103         return $this->formatDate($date, Mage_Core_Model_Locale::FORMAT_TYPE_LONG);
00104     }

getBackUrl (  ) 

Definition at line 64 of file View.php.

00065     {
00066         return Mage::getUrl('review/customer');
00067     }

getProductData (  ) 

Definition at line 45 of file View.php.

00046     {
00047         if( $this->getReviewId() && !$this->getProductCacheData() ) {
00048             $product = Mage::getModel('catalog/product')
00049                 ->setStoreId(Mage::app()->getStore()->getId())
00050                 ->load($this->getReviewData()->getEntityPkValue());
00051             $this->setProductCacheData($product);
00052         }
00053         return $this->getProductCacheData();
00054     }

getRating (  ) 

Definition at line 69 of file View.php.

00070     {
00071         if( !$this->getRatingCollection() ) {
00072             $ratingCollection = Mage::getModel('rating/rating_option_vote')
00073                 ->getResourceCollection()
00074                 ->setReviewFilter($this->getReviewId())
00075                 ->addRatingInfo(Mage::app()->getStore()->getId())
00076                 ->setStoreFilter(Mage::app()->getStore()->getId())
00077                 ->load();
00078 
00079             $this->setRatingCollection( ( $ratingCollection->getSize() ) ? $ratingCollection : false );
00080         }
00081 
00082         return $this->getRatingCollection();
00083     }

getRatingSummary (  ) 

Definition at line 85 of file View.php.

00086     {
00087         if( !$this->getRatingSummaryCache() ) {
00088             $this->setRatingSummaryCache(Mage::getModel('rating/rating')->getEntitySummary($this->getProductData()->getId()));
00089         }
00090         return $this->getRatingSummaryCache();
00091     }

getReviewData (  ) 

Definition at line 56 of file View.php.

00057     {
00058         if( $this->getReviewId() && !$this->getReviewCachedData() ) {
00059             $this->setReviewCachedData(Mage::getModel('review/review')->load($this->getReviewId()));
00060         }
00061         return $this->getReviewCachedData();
00062     }

getTotalReviews (  ) 

Definition at line 93 of file View.php.

00094     {
00095         if( !$this->getTotalReviewsCache() ) {
00096             $this->setTotalReviewsCache(Mage::getModel('review/review')->getTotalReviews($this->getProductData()->getId()), false, Mage::app()->getStore()->getId());
00097         }
00098         return $this->getTotalReviewsCache();
00099     }


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

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