예제 #1
1
 /**
  * Unserialize after loading
  *
  * @param \Magento\Framework\DataObject $object
  * @return $this
  */
 public function afterLoad($object)
 {
     parent::afterLoad($object);
     $this->_unserialize($object);
     return $this;
 }
예제 #2
1
파일: Category.php 프로젝트: aiesh/magento2
 /**
  * Set category ids to product data
  *
  * @param \Magento\Catalog\Model\Product $object
  * @return $this
  */
 public function afterLoad($object)
 {
     $object->setData($this->getAttribute()->getAttributeCode(), $object->getCategoryIds());
     return parent::afterLoad($object);
 }
예제 #3
1
 /**
  * Set inventory data to custom attribute
  *
  * @param Product $object
  * @return $this
  */
 public function afterLoad($object)
 {
     $stockItem = $this->stockRegistry->getStockItem($object->getId(), $object->getStore()->getWebsiteId());
     $object->setData($this->getAttribute()->getAttributeCode(), ['is_in_stock' => $stockItem->getIsInStock(), 'qty' => $stockItem->getQty()]);
     return parent::afterLoad($object);
 }
예제 #4
1
파일: Stock.php 프로젝트: aiesh/magento2
 /**
  * Set inventory data to custom attribute
  *
  * @param Product $object
  * @return $this
  */
 public function afterLoad($object)
 {
     $stockItemDo = $this->stockItemService->getStockItem($object->getId());
     $object->setData($this->getAttribute()->getAttributeCode(), array('is_in_stock' => $stockItemDo->getIsInStock(), 'qty' => $stockItemDo->getQty()));
     return parent::afterLoad($object);
 }