コード例 #1
0
ファイル: Collection.php プロジェクト: nja78/magento2
 /**
  * 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
ファイル: AbstractCollection.php プロジェクト: nja78/magento2
 /**
  * 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
ファイル: Collection.php プロジェクト: nja78/magento2
 /**
  * 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
ファイル: Collection.php プロジェクト: nja78/magento2
 /**
  * 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
ファイル: Collection.php プロジェクト: nja78/magento2
 /**
  * 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
ファイル: Collection.php プロジェクト: nja78/magento2
 /**
  * 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;
 }