示例#1
0
 /**
  * Unserialize additional_information in each item
  *
  * @return $this
  */
 protected function _afterLoad()
 {
     foreach ($this->_items as $item) {
         $this->getResource()->unserializeFields($item);
     }
     return parent::_afterLoad();
 }
示例#2
0
 /**
  * get select count sql
  *
  * @return \Zend_Db_Select
  */
 public function getSelectCountSql()
 {
     if (!$this->_countSelect instanceof \Zend_Db_Select) {
         $this->setSelectCountSql(parent::getSelectCountSql());
     }
     return $this->_countSelect;
 }
示例#3
0
 /**
  * Don't add item to the collection if only fixed are allowed and its carrier is not fixed
  *
  * @param \Magento\Quote\Model\Quote\Address\Rate $rate
  * @return $this
  */
 public function addItem(\Magento\Framework\Object $rate)
 {
     $carrier = $this->_carrierFactory->get($rate->getCarrier());
     if ($this->_allowFixedOnly && (!$carrier || !$carrier->isFixed())) {
         return $this;
     }
     return parent::addItem($rate);
 }
示例#4
0
 /**
  * Set parent items
  *
  * @return $this
  */
 protected function _afterLoad()
 {
     parent::_afterLoad();
     /**
      * Assign parent items
      */
     foreach ($this as $item) {
         if ($item->getParentItemId()) {
             $item->setParentItem($this->getItemById($item->getParentItemId()));
         }
     }
     return $this;
 }
示例#5
0
 /**
  * After load processing
  *
  * @return $this
  */
 protected function _afterLoad()
 {
     parent::_afterLoad();
     /**
      * Assign parent items
      */
     foreach ($this as $item) {
         if ($item->getParentItemId()) {
             $item->setParentItem($this->getItemById($item->getParentItemId()));
         }
         if ($this->_quote) {
             $item->setQuote($this->_quote);
         }
     }
     /**
      * Assign options and products
      */
     $this->_assignOptions();
     $this->_assignProducts();
     $this->resetItemsDataChanged();
     return $this;
 }
示例#6
0
 /**
  * Redeclare after load method for dispatch event
  *
  * @return $this
  */
 protected function _afterLoad()
 {
     parent::_afterLoad();
     $this->_eventManager->dispatch($this->_eventPrefix . '_load_after', [$this->_eventObject => $this]);
     return $this;
 }