1 | <?php |
||
13 | class CartDiscount |
||
14 | { |
||
15 | /** |
||
16 | * Discount text |
||
17 | * @var string |
||
18 | */ |
||
19 | private $discountText; |
||
20 | |||
21 | /** |
||
22 | * Price after discount |
||
23 | * @var int|float |
||
24 | */ |
||
25 | private $priceAfterDiscount; |
||
26 | |||
27 | /** |
||
28 | * Price format object |
||
29 | * @var \Plane\Shop\PriceFormat\PriceFormatInterface |
||
30 | */ |
||
31 | private $priceFormat; |
||
32 | |||
33 | /** |
||
34 | * Set discount text |
||
35 | * @param string $discountText |
||
36 | */ |
||
37 | public function setDiscountText($discountText) |
||
41 | |||
42 | /** |
||
43 | * Set price after discount |
||
44 | * @param double $priceAfterDiscount |
||
45 | */ |
||
46 | public function setPriceAfterDiscount($priceAfterDiscount) |
||
50 | |||
51 | /** |
||
52 | * Return discount text |
||
53 | * @return string |
||
54 | */ |
||
55 | public function getDiscountText() |
||
59 | |||
60 | /** |
||
61 | * Return price after discount |
||
62 | * @return int|float |
||
63 | */ |
||
64 | public function getPriceAfterDiscount() |
||
68 | |||
69 | /** |
||
70 | * Set price format object |
||
71 | * @param \Plane\Shop\PriceFormat\PriceFormatInterface $priceFormat |
||
72 | */ |
||
73 | public function setPriceFormat(PriceFormatInterface $priceFormat) |
||
77 | |||
78 | /** |
||
79 | * Format price with set price format object |
||
80 | * @param float $price |
||
81 | * @return float |
||
82 | */ |
||
83 | protected function formatPrice($price) |
||
91 | } |
||
92 |