Public Member Functions | |
__construct () | |
addRatingFilter ($rating) | |
setPositionOrder ($dir='ASC') | |
Protected Attributes | |
$_ratingOptionTable | |
$_ratingVoteTable |
Definition at line 34 of file Collection.php.
__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 }
addRatingFilter | ( | $ | rating | ) |
add rating filter
int|array | $rating |
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
string | $dir |
Definition at line 73 of file Collection.php.
00074 { 00075 $this->setOrder($this->_ratingOptionTable.'.position', $dir); 00076 return $this; 00077 }
$_ratingOptionTable [protected] |
Definition at line 36 of file Collection.php.
$_ratingVoteTable [protected] |
Definition at line 37 of file Collection.php.