Mage_Review_Block_Form Class Reference

Inheritance diagram for Mage_Review_Block_Form:

Mage_Core_Block_Template Mage_Core_Block_Abstract Varien_Object

List of all members.

Public Member Functions

 __construct ()
 getProductInfo ()
 getAction ()
 getRatings ()


Detailed Description

Definition at line 34 of file Form.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 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     }


Member Function Documentation

getAction (  ) 

Retrieve current action object

Returns:
Mage_Core_Controller_Varien_Action

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     }


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