Public Member Functions | |
__construct () | |
getProductData () | |
getReviewData () | |
getBackUrl () | |
getRating () | |
getRatingSummary () | |
getTotalReviews () | |
dateFormat ($date) |
Definition at line 35 of file View.php.
__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/view.phtml'); 00041 00042 $this->setReviewId($this->getRequest()->getParam('id', false)); 00043 }
dateFormat | ( | $ | date | ) |
Definition at line 96 of file View.php.
00097 { 00098 return $this->formatDate($date, Mage_Core_Model_Locale::FORMAT_TYPE_LONG); 00099 }
getBackUrl | ( | ) |
Definition at line 61 of file View.php.
00062 { 00063 return Mage::getUrl('*/*/list', array('id' => $this->getProductData()->getId())); 00064 }
getProductData | ( | ) |
Definition at line 45 of file View.php.
00046 { 00047 if( $this->getReviewId() && !$this->getProductCacheData() ) { 00048 $this->setProductCacheData(Mage::getModel('catalog/product')->load($this->getReviewData()->getEntityPkValue())); 00049 } 00050 return $this->getProductCacheData(); 00051 }
getRating | ( | ) |
Definition at line 66 of file View.php.
00067 { 00068 if( !$this->getRatingCollection() ) { 00069 $ratingCollection = Mage::getModel('rating/rating_option_vote') 00070 ->getResourceCollection() 00071 ->setReviewFilter($this->getReviewId()) 00072 ->setStoreFilter(Mage::app()->getStore()->getId()) 00073 ->addRatingInfo(Mage::app()->getStore()->getId()) 00074 ->load(); 00075 $this->setRatingCollection( ( $ratingCollection->getSize() ) ? $ratingCollection : false ); 00076 } 00077 return $this->getRatingCollection(); 00078 }
getRatingSummary | ( | ) |
Definition at line 80 of file View.php.
00081 { 00082 if( !$this->getRatingSummaryCache() ) { 00083 $this->setRatingSummaryCache(Mage::getModel('rating/rating')->getEntitySummary($this->getProductData()->getId())); 00084 } 00085 return $this->getRatingSummaryCache(); 00086 }
getReviewData | ( | ) |
Definition at line 53 of file View.php.
00054 { 00055 if( $this->getReviewId() && !$this->getReviewCachedData() ) { 00056 $this->setReviewCachedData(Mage::getModel('review/review')->load($this->getReviewId())); 00057 } 00058 return $this->getReviewCachedData(); 00059 }
getTotalReviews | ( | ) |
Definition at line 88 of file View.php.
00089 { 00090 if( !$this->getTotalReviewsCache() ) { 00091 $this->setTotalReviewsCache(Mage::getModel('review/review')->getTotalReviews($this->getProductData()->getId(), false, Mage::app()->getStore()->getId())); 00092 } 00093 return $this->getTotalReviewsCache(); 00094 }