Esempio n. 1
0
 /**
  * @param \Generated\Shared\Transfer\OrderListTransfer $orderListTransfer
  * @param int $idCustomer
  *
  * @return \Generated\Shared\Transfer\OrderListTransfer
  */
 public function getOrders(OrderListTransfer $orderListTransfer, $idCustomer)
 {
     $orderCollection = $this->queryContainer->queryCustomerOrders($idCustomer, $orderListTransfer->getFilter())->find();
     $orders = $this->hydrateOrderListCollectionTransferFromEntityCollection($orderCollection);
     $orderListTransfer->setOrders($orders);
     return $orderListTransfer;
 }
Esempio n. 2
0
 /**
  * @param int $idSalesOrder
  *
  * @return string[]
  */
 public function getDistinctOrderStates($idSalesOrder)
 {
     $orderItems = $this->queryContainer->querySalesOrderItemsByIdSalesOrder($idSalesOrder)->find();
     $states = [];
     foreach ($orderItems as $orderItem) {
         $states[$orderItem->getState()->getName()] = $orderItem->getState()->getName();
     }
     return $states;
 }
Esempio n. 3
0
 /**
  * @param \Generated\Shared\Transfer\OrderTransfer $orderTransfer
  * @param int $idSalesOrder
  *
  * @return bool
  */
 public function update(OrderTransfer $orderTransfer, $idSalesOrder)
 {
     $orderEntity = $this->queryContainer->querySalesOrderById($idSalesOrder)->findOne();
     if (empty($orderEntity)) {
         return false;
     }
     $this->hydrateEntityFromOrderTransfer($orderTransfer, $orderEntity);
     $orderEntity->save();
     return true;
 }
 /**
  * @param \Generated\Shared\Transfer\OrderTransfer $orderTransfer
  *
  * @return \Orm\Zed\Sales\Persistence\SpySalesOrderItem[]|\Propel\Runtime\Collection\ObjectCollection
  */
 protected function getSalesOrderItems(OrderTransfer $orderTransfer)
 {
     $saleOrderItemIds = $this->getSaleOrderItemIds($orderTransfer);
     if (empty($saleOrderItemIds)) {
         return [];
     }
     return $this->salesQueryContainer->querySalesOrderItem()->filterByIdSalesOrderItem($saleOrderItemIds, Criteria::IN)->find();
 }
Esempio n. 5
0
 /**
  * @param int $idSalesOrder
  *
  * @return \Orm\Zed\Sales\Persistence\SpySalesOrder
  */
 protected function getSalesOrderByIdSalesOrder($idSalesOrder)
 {
     return $this->queryContainer->querySalesOrderById($idSalesOrder)->findOne();
 }
Esempio n. 6
0
 /**
  * @param \Generated\Shared\Transfer\ExpenseTransfer $expenseTransfer
  *
  * @return \Orm\Zed\Sales\Persistence\SpySalesExpense
  */
 protected function getExpenseEntity(ExpenseTransfer $expenseTransfer)
 {
     $salesExpenseEntity = $this->salesQueryContainer->querySalesExpense()->findOneByIdSalesExpense($expenseTransfer->getIdSalesExpense());
     return $salesExpenseEntity;
 }
Esempio n. 7
0
 /**
  * @param int $idCustomer
  *
  * @return int
  */
 protected function getTotalCustomerOrderCount($idCustomer)
 {
     $totalOrderCount = $this->queryContainer->querySalesOrder()->findByFkCustomer($idCustomer)->count();
     return $totalOrderCount;
 }
Esempio n. 8
0
 /**
  * @param int $idSalesOrder
  *
  * @return \Generated\Shared\Transfer\OrderDetailsCommentsTransfer
  */
 public function getCommentsByIdSalesOrder($idSalesOrder)
 {
     $commentsCollection = $this->queryContainer->queryCommentsByIdSalesOrder($idSalesOrder)->find();
     return $this->hydrateCommentCollectionFromEntityCollection($commentsCollection);
 }