| 1 |
<?php |
| 2 |
/** |
| 3 |
* Quote Formatter Helper Class |
| 4 |
* |
| 5 |
* @package Easy_Invoice |
| 6 |
* @subpackage Helpers |
| 7 |
*/ |
| 8 |
|
| 9 |
namespace EasyInvoice\Helpers; |
| 10 |
|
| 11 |
use EasyInvoice\Traits\CurrencyTrait; |
| 12 |
|
| 13 |
/** |
| 14 |
* Quote Formatter Class |
| 15 |
* |
| 16 |
* Handles formatting of quote values |
| 17 |
*/ |
| 18 |
class QuoteFormatter { |
| 19 |
use CurrencyTrait; |
| 20 |
|
| 21 |
/** |
| 22 |
* The quote object |
| 23 |
* |
| 24 |
* @var mixed |
| 25 |
*/ |
| 26 |
private $quote; |
| 27 |
|
| 28 |
/** |
| 29 |
* Constructor |
| 30 |
* |
| 31 |
* @param mixed $quote The quote object |
| 32 |
*/ |
| 33 |
public function __construct($quote = null) { |
| 34 |
$this->quote = $quote; |
| 35 |
} |
| 36 |
|
| 37 |
/** |
| 38 |
* Format a currency amount |
| 39 |
* |
| 40 |
* @param float $amount The amount to format |
| 41 |
* @return string The formatted amount |
| 42 |
*/ |
| 43 |
public function format($amount) { |
| 44 |
return $this->formatCurrency($amount, $this->quote); |
| 45 |
} |
| 46 |
} |