1 | <?php |
||
14 | class Order |
||
15 | { |
||
16 | /** |
||
17 | * @var string REQUIRED! The unique identifier for this Order/Transaction |
||
18 | */ |
||
19 | protected $transactionID; |
||
20 | |||
21 | /** |
||
22 | * @param int $id number The ID |
||
23 | * |
||
24 | * @return $this |
||
25 | */ |
||
26 | public function setTransactionID($id) |
||
32 | |||
33 | /** |
||
34 | * @return string |
||
35 | */ |
||
36 | public function getTransactionID() |
||
40 | |||
41 | /** |
||
42 | * @var string the name of the store that handled the Order/Transaction |
||
43 | */ |
||
44 | protected $storeName = ''; |
||
45 | |||
46 | /** |
||
47 | * @param string $name The name of the store |
||
48 | * |
||
49 | * @return $this |
||
50 | */ |
||
51 | public function setStoreName($name) |
||
57 | |||
58 | /** |
||
59 | * @return string |
||
60 | */ |
||
61 | public function getStoreName() |
||
65 | |||
66 | /** |
||
67 | * REQUIREd! |
||
68 | * |
||
69 | * @return string The total. Calculated automatically and returned as string. |
||
70 | */ |
||
71 | public function getTotal() |
||
75 | |||
76 | /** |
||
77 | * @return int|string |
||
78 | */ |
||
79 | public function getTaxesTotal() |
||
83 | |||
84 | protected $shippingTotal = ''; |
||
85 | |||
86 | /** |
||
87 | * @param $total string|number |
||
88 | * |
||
89 | * @return $this |
||
90 | */ |
||
91 | public function setShippingTotal($total) |
||
97 | |||
98 | /** |
||
99 | * @return string |
||
100 | */ |
||
101 | public function getShippingTotal() |
||
105 | |||
106 | /** |
||
107 | * @var array(of OrderItem) An array of OrderItem objects |
||
108 | */ |
||
109 | public $orderItems = array(); |
||
110 | |||
111 | /** |
||
112 | * @var string city the order was shipped to |
||
113 | */ |
||
114 | protected $city = ''; |
||
115 | |||
116 | /** |
||
117 | * @param string $city |
||
118 | * |
||
119 | * @return $this |
||
120 | */ |
||
121 | public function setCity($city) |
||
127 | |||
128 | /** |
||
129 | * @return string |
||
130 | */ |
||
131 | public function getCity() |
||
135 | |||
136 | /** |
||
137 | * @var string state or province the order was shipped to |
||
138 | */ |
||
139 | protected $stateOrProvince = ''; |
||
140 | |||
141 | /** |
||
142 | * @param string $stateOrProvince |
||
143 | * |
||
144 | * @return $this |
||
145 | */ |
||
146 | public function setStateOrProvince($stateOrProvince) |
||
152 | |||
153 | /** |
||
154 | * @return string |
||
155 | */ |
||
156 | public function getStateOrProvince() |
||
160 | |||
161 | /** |
||
162 | * @var string country the order was shipped to |
||
163 | */ |
||
164 | protected $country = ''; |
||
165 | |||
166 | /** |
||
167 | * @param string $country |
||
168 | * |
||
169 | * @return $this |
||
170 | */ |
||
171 | public function setCountry($country) |
||
177 | |||
178 | /** |
||
179 | * @return string |
||
180 | */ |
||
181 | public function getCountry() |
||
185 | |||
186 | /** |
||
187 | * Loops over the OrderItems and accumulates the value of the given property. Can also be a getter. |
||
188 | * |
||
189 | * @param $property |
||
190 | * |
||
191 | * @return int|string |
||
192 | */ |
||
193 | private function accumulatePropertyOnOrderItems($property) |
||
206 | } |
||
207 |
This check looks for assignments to scalar types that may be of the wrong type.
To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.