1 | <?php namespace Darryldecode\Cart; |
||
12 | class ItemCollection extends Collection { |
||
13 | |||
14 | /** |
||
15 | * Sets the number of decimal points. |
||
16 | * |
||
17 | * @var |
||
18 | */ |
||
19 | protected $decimals; |
||
20 | |||
21 | /** |
||
22 | * Definces the decimal point delimiter type |
||
23 | * |
||
24 | * @var |
||
25 | */ |
||
26 | protected $dec_point; |
||
27 | |||
28 | /** |
||
29 | * Defines the thousands point delimiter type |
||
30 | * |
||
31 | * @var |
||
32 | */ |
||
33 | protected $thousands_sep; |
||
34 | |||
35 | /** |
||
36 | * ItemCollection constructor. |
||
37 | * @param array|mixed $items |
||
38 | * @param $config |
||
39 | */ |
||
40 | public function __construct($items, $config) |
||
48 | |||
49 | /** |
||
50 | * get the sum of price |
||
51 | * |
||
52 | * @return mixed|null |
||
53 | */ |
||
54 | public function getPriceSum() |
||
58 | |||
59 | public function __get($name) |
||
60 | { |
||
61 | if( $this->has($name) ) return $this->get($name); |
||
62 | return null; |
||
63 | } |
||
64 | |||
65 | /** |
||
66 | * check if item has conditions |
||
67 | * |
||
68 | * @return bool |
||
69 | */ |
||
70 | public function hasConditions() |
||
82 | |||
83 | /** |
||
84 | * get the single price in which conditions are already applied |
||
85 | * |
||
86 | * @return mixed|null |
||
87 | */ |
||
88 | public function getPriceWithConditions() |
||
120 | |||
121 | /** |
||
122 | * get the sum of price in which conditions are already applied |
||
123 | * |
||
124 | * @return mixed|null |
||
125 | */ |
||
126 | public function getPriceSumWithConditions() |
||
130 | } |
||
131 |
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.