Public Member Functions | |
__construct () | |
getProductInfo () | |
getAction () | |
getRatings () |
Definition at line 34 of file Form.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 36 of file Form.php.
00037 { 00038 parent::__construct(); 00039 00040 $data = Mage::getSingleton('review/session')->getFormData(true); 00041 $data = new Varien_Object($data); 00042 00043 // add logged in customer name as nickname 00044 if (!$data->getNickname()) { 00045 $customer = Mage::getSingleton('customer/session')->getCustomer(); 00046 if ($customer && $customer->getId()) { 00047 $data->setNickname($customer->getFirstname()); 00048 } 00049 } 00050 00051 $this->setTemplate('review/form.phtml') 00052 ->assign('data', $data) 00053 ->assign('messages', Mage::getSingleton('review/session')->getMessages(true)); 00054 }
getAction | ( | ) |
Retrieve current action object
Reimplemented from Mage_Core_Block_Abstract.
Definition at line 62 of file Form.php.
00063 { 00064 $productId = Mage::app()->getRequest()->getParam('id', false); 00065 return Mage::getUrl('review/product/post', array('id' => $productId)); 00066 }
getProductInfo | ( | ) |
Definition at line 56 of file Form.php.
00057 { 00058 $product = Mage::getModel('catalog/product'); 00059 return $product->load($this->getRequest()->getParam('id')); 00060 }
getRatings | ( | ) |
Definition at line 68 of file Form.php.
00069 { 00070 $ratingCollection = Mage::getModel('rating/rating') 00071 ->getResourceCollection() 00072 ->addEntityFilter('product') 00073 ->setPositionOrder() 00074 ->addRatingPerStoreName(Mage::app()->getStore()->getId()) 00075 ->setStoreFilter(Mage::app()->getStore()->getId()) 00076 ->load() 00077 ->addOptionToItems(); 00078 return $ratingCollection; 00079 }