コード例 #1
0
ファイル: ShopOrder.php プロジェクト: HenryTelecom/wwwroot
 /**
  * 
  */
 public function calculateTotal()
 {
     $total = 0;
     foreach ($this->orders as $order) {
         $product = $order->getProduct();
         $price = $product->getPrice();
         if ($this->user->getCeten()) {
             $price = $product->getCetenPrice();
         }
         $price *= $order->getCount();
         $total += $price;
     }
     $this->total = $total;
 }