1: <?php
2: namespace Datadepo\Api\Structures;
3:
4: /**
5: * @property-read string $currency
6: * @property-read double $tax
7: * @property-read double $rabat
8: * @property-read double $margin
9: * @property-read double $priceRetail
10: * @property-read double $price
11: * @property-read double $pricePhe
12: * @property-read double $priceMin
13: * @property-read double $priceSale
14: * @property-read double $priceSaleFinal
15: */
16: class PriceLine extends AbstractStructure
17: {
18:
19: /** @var string */
20: protected $currency;
21:
22: /**
23: * @param array $data
24: * @param string $currency
25: */
26: public function __construct($data, $currency)
27: {
28: $this->data = $data;
29: $this->currency = $currency;
30: }
31:
32: /**
33: * @return string
34: */
35: public function getJson()
36: {
37: return json_encode($this->data);
38: }
39:
40: /**
41: * @return string
42: */
43: public function getPrimary()
44: {
45: return $this->getCurrency();
46: }
47:
48: /**
49: * @return string
50: */
51: public function getCurrency()
52: {
53: return $this->currency;
54: }
55:
56: /**
57: * @return double
58: */
59: public function getTax()
60: {
61: return $this->data->tax;
62: }
63:
64: /**
65: * @return double
66: */
67: public function getRabat()
68: {
69: return $this->data->rabat;
70: }
71:
72: /**
73: * @return double
74: */
75: public function getMargin()
76: {
77: return $this->data->margin;
78: }
79:
80: /**
81: * Recommended MOC
82: * @return double
83: */
84: public function getPriceRetail()
85: {
86: return $this->data->priceRetail;
87: }
88:
89: /**
90: * Order price
91: * @return double
92: */
93: public function getPrice()
94: {
95: return $this->data->price;
96: }
97:
98: /**
99: * Additional dues (is not included in sale price)
100: * @return double
101: */
102: public function getPricePhe()
103: {
104: return $this->data->pricePhe;
105: }
106:
107: /**
108: * Minimal sale price
109: * @return double
110: */
111: public function getPriceMin()
112: {
113: return $this->data->priceMin;
114: }
115:
116: /**
117: * Sale price without dues and price add
118: * @return double
119: */
120: public function getPriceSale()
121: {
122: return $this->data->priceSale;
123: }
124:
125: /**
126: * Sale price (include dues and price add)
127: * @return double
128: */
129: public function getPriceSaleFinal()
130: {
131: return $this->getPriceSale() + $this->getPricePhe();
132: }
133:
134: }