1 | <?php defined('SYSPATH') OR die('No direct script access.'); |
||
12 | class Kohana_Model_Brand_Purchase_Shipping extends Jam_Model implements Sellable, FreezableInterface { |
||
13 | |||
14 | use FreezableTrait; |
||
15 | |||
16 | /** |
||
17 | * @codeCoverageIgnore |
||
18 | */ |
||
19 | public static function initialize(Jam_Meta $meta) |
||
37 | |||
38 | /** |
||
39 | * Implement Sellable |
||
40 | * Returns the computed price of all of its items |
||
41 | * @param Model_Purchase_Item $item |
||
42 | * @return Jam_Price |
||
43 | */ |
||
44 | 2 | public function price_for_purchase_item(Model_Purchase_Item $item) |
|
48 | |||
49 | 1 | public function name() |
|
53 | |||
54 | 2 | public function total_price() |
|
72 | |||
73 | 4 | public function available_items() |
|
79 | |||
80 | 1 | public function duplicate() |
|
91 | |||
92 | 1 | public function items_from(array $purchase_items) |
|
110 | |||
111 | /** |
||
112 | * Get the merge of all total_delivery_time ranges from the items |
||
113 | * By getting the maximum min and max amounts. |
||
114 | * @return Jam_Range |
||
115 | */ |
||
116 | 2 | public function total_delivery_time() |
|
124 | |||
125 | /** |
||
126 | * Return the day all the items should be shipped |
||
127 | * @return Jam_Range |
||
128 | */ |
||
129 | 1 | public function total_shipping_date() |
|
139 | |||
140 | /** |
||
141 | * Total price for the purchased items |
||
142 | * @throws Kohana_Exception If brand_purchase is NULL |
||
143 | * @return Jam_Price |
||
144 | */ |
||
145 | 2 | public function total_purchase_price() |
|
151 | |||
152 | /** |
||
153 | * Return the paid at date |
||
154 | * @return string |
||
155 | */ |
||
156 | 1 | public function paid_at() |
|
160 | |||
161 | /** |
||
162 | * Get the currency to be used in all the calculations |
||
163 | * @return string |
||
164 | */ |
||
165 | 2 | public function currency() |
|
171 | |||
172 | /** |
||
173 | * Get the location to be used in all the calculations |
||
174 | * @return string |
||
175 | */ |
||
176 | 2 | public function ship_to() |
|
183 | |||
184 | /** |
||
185 | * Get the monetary object to be used in all the calculations |
||
186 | * @return Monetary |
||
187 | */ |
||
188 | 2 | public function monetary() |
|
194 | |||
195 | /** |
||
196 | * Build Shipping_Items based on purchase items and method, as well as the ship_to() method |
||
197 | * @param array $purchase_items array of Model_Purchase_Item objects |
||
198 | * @param Model_Shipping_Method $method |
||
199 | * @return $this |
||
200 | */ |
||
201 | 1 | public function build_items_from(array $purchase_items, Model_Shipping_Method $method = NULL) |
|
207 | |||
208 | /** |
||
209 | * Build a single shipping_item and add it to the items of this brand_purchase_shipping. |
||
210 | * @param Model_Purchase_Item $purchase_item |
||
211 | * @param Model_Shipping_Method $method |
||
212 | * @return Model_Brand_Purchase_Shipping |
||
213 | */ |
||
214 | 2 | public function build_item_from(Model_Purchase_Item $purchase_item, Model_Shipping_Method $method = NULL) |
|
223 | |||
224 | 1 | public function new_items_from(array $purchase_items, Model_Location $location, $method = NULL) |
|
225 | { |
||
226 | 1 | Array_Util::validate_instance_of($purchase_items, 'Model_Purchase_Item'); |
|
227 | |||
228 | 1 | $self = $this; |
|
229 | |||
230 | return array_map(function($purchase_item) use ($location, $method, $self) { |
||
231 | 1 | return $self->new_item_from($purchase_item, $location, $method); |
|
232 | 1 | }, $purchase_items); |
|
233 | } |
||
234 | |||
235 | 2 | public function update_items_address(Model_Brand_Purchase_Shipping $brand_purchase_shipping) |
|
242 | |||
243 | 2 | public function new_item_from(Model_Purchase_Item $purchase_item, Model_Location $location, Model_Shipping_Method $method = NULL) |
|
254 | |||
255 | 1 | public function freeze() |
|
261 | |||
262 | public function unfreeze() |
||
268 | |||
269 | public function isFrozen() |
||
273 | |||
274 | 1 | protected function setFrozen($frozen) |
|
280 | |||
281 | 1 | public function performFreeze() |
|
287 | |||
288 | public function performUnfreeze() |
||
293 | |||
294 | 1 | public function freezeCollection() |
|
301 | |||
302 | public function unfreezeCollection() |
||
309 | } |
||
310 |
Since your code implements the magic getter
_get
, this function will be called for any read access on an undefined variable. You can add the@property
annotation to your class or interface to document the existence of this variable.If the property has read access only, you can use the @property-read annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.