|
- <?php
-
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
-
- namespace common\models ;
-
- class Document extends ActiveRecordCommon
- {
- public function getAmount($type = Order::AMOUNT_TOTAL, $format = false)
- {
- $amount = 0 ;
- $ordersArray = $this->orders ;
-
- foreach($ordersArray as $order) {
- $order->init() ;
- $amount += $order->getAmount($type) ;
- }
-
- if ($format) {
- return Price::format($amount) ;
- }
- else {
- return $amount;
- }
- }
- }
|