/**
  * Load collection data
  *
  * @param bool $printQuery
  * @param bool $logQuery
  * @return $this
  */
 public function load($printQuery = false, $logQuery = false)
 {
     if (!$this->getLoadDefault()) {
         $this->setWithoutDefaultFilter();
     }
     if (!$this->isLoaded()) {
         $this->addOrder('CASE WHEN main_table.store_id = 0 THEN 0 ELSE 1 END', \Magento\Framework\DB\Select::SQL_ASC)->addOrder('main_table.sort_order', \Magento\Framework\DB\Select::SQL_ASC)->addOrder('main_table.name', \Magento\Framework\DB\Select::SQL_ASC);
     }
     return parent::load($printQuery, $logQuery);
 }
 /**
  * Adds subscribers info to select and loads collection
  *
  * @param bool $printQuery
  * @param bool $logQuery
  * @return $this
  */
 public function load($printQuery = false, $logQuery = false)
 {
     if ($this->_addSubscribersFlag && !$this->isLoaded()) {
         $this->_addSubscriberInfoToSelect();
     }
     return parent::load($printQuery, $logQuery);
 }
 /**
  * Load data (join attribute data)
  *
  * @param bool $printQuery
  * @param bool $logQuery
  * @return $this
  */
 public function load($printQuery = false, $logQuery = false)
 {
     if (!$this->isLoaded()) {
         $this->_joinAttributeData();
     }
     return parent::load($printQuery, $logQuery);
 }
Exemple #4
0
 /**
  * Load collection data
  *
  * @param boolean $printQuery
  * @param boolean $logQuery
  * @return $this
  */
 public function load($printQuery = false, $logQuery = false)
 {
     $this->unshiftOrder('main_table.name', \Magento\Framework\DB\Select::SQL_ASC)->unshiftOrder('main_table.sort_order', \Magento\Framework\DB\Select::SQL_ASC);
     // website sort order FIRST
     return parent::load($printQuery, $logQuery);
 }
 /**
  * Load data
  *
  * @param bool $printQuery
  * @param bool $logQuery
  * @return $this
  */
 public function load($printQuery = false, $logQuery = false)
 {
     if ($this->isLoaded()) {
         return $this;
     }
     $this->_eventManager->dispatch('rating_rating_collection_load_before', ['collection' => $this]);
     parent::load($printQuery, $logQuery);
     if ($this->_addStoreDataFlag) {
         $this->_addStoreData();
     }
     return $this;
 }
 /**
  * Loads collecion and adds customers info
  *
  * @param bool $printQuery
  * @param bool $logQuery
  * @return $this
  */
 public function load($printQuery = false, $logQuery = false)
 {
     parent::load($printQuery, $logQuery);
     if ($this->_subscribersInfoJoinedFlag) {
         $this->_addCustomersData();
     }
     return $this;
 }