Mage_Rating_Model_Mysql4_Rating_Option_Collection Class Reference

Inheritance diagram for Mage_Rating_Model_Mysql4_Rating_Option_Collection:

Varien_Data_Collection_Db Varien_Data_Collection

List of all members.

Public Member Functions

 __construct ()
 addRatingFilter ($rating)
 setPositionOrder ($dir='ASC')

Protected Attributes

 $_ratingOptionTable
 $_ratingVoteTable


Detailed Description

Definition at line 34 of file Collection.php.


Constructor & Destructor Documentation

__construct (  ) 

Reimplemented from Varien_Data_Collection.

Definition at line 39 of file Collection.php.

00040     {
00041         parent::__construct(Mage::getSingleton('core/resource')->getConnection('rating_read'));
00042         $this->_ratingOptionTable   = Mage::getSingleton('core/resource')->getTableName('rating/rating_option');
00043         $this->_ratingVoteTable     = Mage::getSingleton('core/resource')->getTableName('rating/rating_vote');
00044 
00045         $this->_select->from($this->_ratingOptionTable);
00046 
00047         $this->setItemObjectClass(Mage::getConfig()->getModelClassName('rating/rating_option'));
00048     }


Member Function Documentation

addRatingFilter ( rating  ) 

add rating filter

Parameters:
int|array $rating
Returns:
Varien_Data_Collection_Db

Definition at line 56 of file Collection.php.

00057     {
00058         if (is_numeric($rating)) {
00059             $this->addFilter('rating_id', $rating);
00060         }
00061         elseif (is_array($rating)) {
00062             $this->addFilter('rating_id', $this->_getConditionSql('rating_id', array('in'=>$rating)), 'string');
00063         }
00064         return $this;
00065     }

setPositionOrder ( dir = 'ASC'  ) 

set order by position field

Parameters:
string $dir
Returns:
Varien_Data_Collection_Db

Definition at line 73 of file Collection.php.

00074     {
00075         $this->setOrder($this->_ratingOptionTable.'.position', $dir);
00076         return $this;
00077     }


Member Data Documentation

$_ratingOptionTable [protected]

Definition at line 36 of file Collection.php.

$_ratingVoteTable [protected]

Definition at line 37 of file Collection.php.


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

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