Esempio n. 1
0
 /**
  * Get Stock Data
  *
  * @param StockItemInterface $stockItem
  * @return array
  */
 private function getData(StockItemInterface $stockItem)
 {
     $result = $stockItem->getData();
     $result[StockItemInterface::MANAGE_STOCK] = (int) $stockItem->getManageStock();
     $result[StockItemInterface::QTY] = (double) $stockItem->getQty();
     $result[StockItemInterface::MIN_QTY] = (double) $stockItem->getMinQty();
     $result[StockItemInterface::MIN_SALE_QTY] = (double) $stockItem->getMinSaleQty();
     $result[StockItemInterface::MAX_SALE_QTY] = (double) $stockItem->getMaxSaleQty();
     $result[StockItemInterface::IS_QTY_DECIMAL] = (int) $stockItem->getIsQtyDecimal();
     $result[StockItemInterface::IS_DECIMAL_DIVIDED] = (int) $stockItem->getIsDecimalDivided();
     $result[StockItemInterface::BACKORDERS] = (int) $stockItem->getBackorders();
     $result[StockItemInterface::NOTIFY_STOCK_QTY] = (double) $stockItem->getNotifyStockQty();
     $result[StockItemInterface::ENABLE_QTY_INCREMENTS] = (int) $stockItem->getEnableQtyIncrements();
     $result[StockItemInterface::QTY_INCREMENTS] = (double) $stockItem->getQtyIncrements();
     $result[StockItemInterface::IS_IN_STOCK] = (int) $stockItem->getIsInStock();
     return $result;
 }
 /**
  * @param StockItemInterface $stockItem
  * @return bool
  */
 public function verifyNotification(StockItemInterface $stockItem)
 {
     return (double) $stockItem->getQty() < $stockItem->getNotifyStockQty();
 }