/** * Unserialize additional_information in each item * * @return $this */ protected function _afterLoad() { foreach ($this->_items as $item) { $this->getResource()->unserializeFields($item); } return parent::_afterLoad(); }
/** * 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; }
/** * 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); }
/** * 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; }
/** * 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; }
/** * 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; }