コード例 #1
0
ファイル: Shipment.php プロジェクト: shabbirvividads/magento2
 /**
  * Returns items
  *
  * @return \Magento\Sales\Api\Data\ShipmentItemInterface[]
  */
 public function getItems()
 {
     if ($this->getData(ShipmentInterface::ITEMS) === null) {
         $collection = $this->_shipmentItemCollectionFactory->create()->setShipmentFilter($this->getId());
         if ($this->getId()) {
             foreach ($collection as $item) {
                 $item->setShipment($this);
             }
             $this->setData(ShipmentInterface::ITEMS, $collection->getItems());
         }
     }
     return $this->getData(ShipmentInterface::ITEMS);
 }
コード例 #2
0
ファイル: Shipment.php プロジェクト: Atlis/docker-magento2
 /**
  * @return mixed
  */
 public function getItemsCollection()
 {
     if (empty($this->_items)) {
         $this->_items = $this->_shipmentItemCollectionFactory->create()->setShipmentFilter($this->getId());
         if ($this->getId()) {
             foreach ($this->_items as $item) {
                 $item->setShipment($this);
             }
         }
     }
     return $this->_items;
 }