/**
  * Set order
  *
  * @param string $attribute
  * @param string $dir
  * @return Mage_Reports_Model_Resource_Review_Collection
  */
 public function setOrder($attribute, $dir = self::SORT_ORDER_DESC)
 {
     if (in_array($attribute, array('nickname', 'title', 'detail', 'created_at'))) {
         $this->_select->order($attribute . ' ' . $dir);
     } else {
         parent::setOrder($attribute, $dir);
     }
     return $this;
 }
Example #2
0
 protected function _initSelect()
 {
     parent::_initSelect();
     $this->getSelect()->join(array('rev_details' => $this->_reviewDetailTable), 'main_table.review_id = rev_details.review_id', array('review_reply'));
     return $this;
 }
Example #3
0
 /**
  * Init Select
  *
  * @return Mage_Reports_Model_Resource_Review_Customer_Collection
  */
 protected function _initSelect()
 {
     parent::_initSelect();
     $this->_joinCustomers();
     return $this;
 }
Example #4
0
 /**
  * Load data
  *
  * @param boolean $printQuery
  * @param boolean $logQuery
  * @return Mage_Review_Model_Resource_Review_Collection
  */
 public function load($printQuery = false, $logQuery = false)
 {
     if ($this->isLoaded()) {
         return $this;
     }
     Mage::dispatchEvent('review_review_collection_load_before', array('collection' => $this));
     parent::load($printQuery, $logQuery);
     if ($this->_addStoreDataFlag) {
         $this->_addStoreData();
     }
     return $this;
 }