1 | <?php |
||
14 | class Resource extends \hipanel\base\Model |
||
15 | { |
||
16 | use \hipanel\base\ModelTrait; |
||
17 | |||
18 | /** |
||
19 | * {@inheritdoc} |
||
20 | */ |
||
21 | public function rules() |
||
22 | { |
||
23 | return [ |
||
24 | [['id', 'tariff_id', 'object_id', 'type_id', 'unit_id', 'currency_id', 'hardlim'], 'integer'], |
||
25 | [['type', 'ftype', 'unit', 'unit_factor', 'currency'], 'safe'], |
||
26 | [['price', 'fee', 'quantity', 'discount'], 'number'], |
||
27 | |||
28 | [['object_id', 'type_id'], 'integer', 'on' => ['create', 'update']], |
||
29 | [['type'], 'safe', 'on' => ['create', 'update']], |
||
30 | [['price'], 'number', 'on' => ['create', 'update']], |
||
31 | 'create-required' => [['object_id', 'price'], 'required', 'on' => ['create', 'update']], |
||
32 | ]; |
||
33 | } |
||
34 | |||
35 | public function getTariff() |
||
39 | |||
40 | /** |
||
41 | * {@inheritdoc} |
||
42 | */ |
||
43 | public function attributeLabels() |
||
48 | |||
49 | public function isTypeCorrect() |
||
53 | |||
54 | public function getAvailableTypes() |
||
58 | } |
||
59 |
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.