Mage_Rss_Block_Catalog_Review Class Reference

Inheritance diagram for Mage_Rss_Block_Catalog_Review:

Mage_Rss_Block_Abstract Mage_Core_Block_Template Mage_Core_Block_Abstract Varien_Object

List of all members.

Public Member Functions

 addReviewItemXmlCallback ($args)

Protected Member Functions

 _construct ()
 _toHtml ()


Detailed Description

Definition at line 34 of file Review.php.


Member Function Documentation

_construct (  )  [protected]

Internal constructor, that is called from real constructor

Please override this one instead of overriding real __construct constructor

Please override this one instead of overriding real __construct constructor

Reimplemented from Mage_Core_Block_Abstract.

Definition at line 36 of file Review.php.

00037     {
00038         /*
00039         * setting cache to save the rss for 10 minutes
00040         */
00041         $this->setCacheKey('rss_catalog_review');
00042         $this->setCacheLifetime(600);
00043     }

_toHtml (  )  [protected]

Render block HTML

Returns:
string

Reimplemented from Mage_Core_Block_Template.

Definition at line 45 of file Review.php.

00046     {
00047         $newurl = Mage::getUrl('rss/catalog/review');
00048         $title = Mage::helper('rss')->__('Pending product review(s)');
00049 
00050         $rssObj = Mage::getModel('rss/rss');
00051         $data = array('title' => $title,
00052                 'description' => $title,
00053                 'link'        => $newurl,
00054                 'charset'     => 'UTF-8',
00055                 );
00056         $rssObj->_addHeader($data);
00057 
00058         $reviewModel = Mage::getModel('review/review');
00059 
00060         $collection = $reviewModel->getProductCollection()
00061             ->addStatusFilter($reviewModel->getPendingStatus())
00062             ->addAttributeToSelect('name', 'inner')
00063             ->setDateOrder();
00064 
00065          Mage::getSingleton('core/resource_iterator')
00066             ->walk($collection->getSelect(), array(array($this, 'addReviewItemXmlCallback')), array('rssObj'=> $rssObj, 'reviewModel'=> $reviewModel));
00067         return $rssObj->createRssXml();
00068     }

addReviewItemXmlCallback ( args  ) 

Definition at line 70 of file Review.php.

00071     {
00072         $rssObj = $args['rssObj'];
00073         $reviewModel = $args['reviewModel'];
00074         $row = $args['row'];
00075 
00076         $productUrl = Mage::getUrl('catalog/product/view',array('id'=>$row['entity_id']));
00077         $reviewUrl = Mage::helper('adminhtml')->getUrl('adminhtml/catalog_product_review/edit/', array('id'=>$row['review_id'],'_secure' => true,'_nosecret' => true));
00078         $storeName = Mage::app()->getStore($row['store_id'])->getName();
00079 
00080         $description = '<p>'.
00081         $this->__('Product: <a href="%s">%s</a> <br/>',$productUrl,$row['name']).
00082         $this->__('Summary of review: %s <br/>',$row['title']).
00083         $this->__('Review: %s <br/>', $row['detail']).
00084         $this->__('Store: %s <br/>', $storeName ).
00085         $this->__('click <a href="%s">here</a> to view the review',$reviewUrl).
00086         '</p>'
00087         ;
00088         $data = array(
00089                 'title'         => $this->__('Product: "%s" review By: %s',$row['name'],$row['nickname']),
00090                 'link'          => 'test',
00091                 'description'   => $description,
00092                 );
00093         $rssObj->_addEntry($data);
00094     }


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