1 | <?php |
||
13 | class WeightShippingModifier extends ShippingModifier |
||
14 | { |
||
15 | /** |
||
16 | * Weight to price mapping. |
||
17 | * Should be an associative array, with the weight as key (KG) and the corresponding price as value. |
||
18 | * Can be set via Config API, eg. |
||
19 | * <code> |
||
20 | * WeightShippingModifier: |
||
21 | * weight_cost: |
||
22 | * '0.5': 12 |
||
23 | * '1.0': 15 |
||
24 | * '2.0': 20 |
||
25 | * </code> |
||
26 | * @config |
||
27 | * @var array |
||
28 | */ |
||
29 | protected static $weight_cost = array(); |
||
30 | |||
31 | protected $weight = 0; |
||
32 | |||
33 | /** |
||
34 | * Calculates shipping cost based on Product Weight. |
||
35 | */ |
||
36 | public function value($subtotal = 0) |
||
61 | |||
62 | public function TableTitle() |
||
71 | |||
72 | /** |
||
73 | * Calculate the total weight of the order |
||
74 | * |
||
75 | * @return number |
||
76 | */ |
||
77 | public function Weight() |
||
93 | } |
||
94 |
Since your code implements the magic setter
_set
, this function will be called for any write access on an undefined variable. You can add the@property
annotation to your class or interface to document the existence of this variable.Since the property has write access only, you can use the @property-write 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.