Public Member Functions | |
addProductFilter ($productId) | |
resetSelect () | |
getSelectCountSql () | |
setOrder ($attribute, $dir='desc') | |
Protected Member Functions | |
_construct () |
Definition at line 35 of file Collection.php.
_construct | ( | ) | [protected] |
addProductFilter | ( | $ | productId | ) |
Definition at line 42 of file Collection.php.
00043 { 00044 $this->_select 00045 ->where('main_table.entity_pk_value = ?', $productId); 00046 00047 return $this; 00048 }
getSelectCountSql | ( | ) |
Get SQL for get record count
Reimplemented from Varien_Data_Collection_Db.
Definition at line 57 of file Collection.php.
00058 { 00059 $countSelect = clone $this->_select; 00060 $countSelect->reset(Zend_Db_Select::ORDER); 00061 $countSelect->reset(Zend_Db_Select::LIMIT_COUNT); 00062 $countSelect->reset(Zend_Db_Select::LIMIT_OFFSET); 00063 00064 $sql = $countSelect->__toString(); 00065 00066 $sql = preg_replace('/^select\s+.+?\s+from\s+/is', 'select count(main_table.review_id) from ', $sql); 00067 00068 return $sql; 00069 }
resetSelect | ( | ) |
Definition at line 50 of file Collection.php.
00051 { 00052 parent::resetSelect(); 00053 $this->_joinFields(); 00054 return $this; 00055 }
setOrder | ( | $ | field, | |
$ | direction = 'desc' | |||
) |
Add select order
string | $field | |
string | $direction |
Reimplemented from Varien_Data_Collection_Db.
Definition at line 71 of file Collection.php.
00072 { 00073 $fields = array( 00074 'nickname', 00075 'title', 00076 'detail', 00077 'created_at' 00078 ); 00079 00080 if (in_array($attribute, $fields)) { 00081 $this->_select->order($attribute . ' ' . $dir); 00082 } else { 00083 parent::setOrder($attribute, $dir); 00084 } 00085 00086 return $this; 00087 }