コード例 #1
0
ファイル: Calculator.php プロジェクト: xintang22/Paxifi
 /**
  * Calculate the store profit.
  *
  * @param \Paxifi\Order\Repository\OrderRepositoryInterface $order
  *
  * @return mixed
  */
 public function calculateProfit(OrderRepositoryInterface $order)
 {
     $sales = $order->getTotalSales();
     $costs = $order->getTotalCosts();
     $tax = $order->getTotalTax();
     return $sales - $costs - $tax - $this->calculateCommission($order);
 }
コード例 #2
0
ファイル: OrderTransformer.php プロジェクト: xintang22/Paxifi
 /**
  * @param OrderRepositoryInterface $order
  *
  * @return array
  */
 public function transform(OrderRepositoryInterface $order)
 {
     return array('id' => $order->id, 'total_costs' => $order->getTotalCosts(), 'total_sales' => $order->getTotalSales(), 'total_tax' => $order->getTotalTax(), 'products' => $this->embedProducts($order));
 }