1 | <?php |
||
10 | abstract class AbstractTariffForm extends \yii\base\Model |
||
11 | { |
||
12 | /** |
||
13 | * @var int Tariff ID |
||
14 | */ |
||
15 | public $id; |
||
16 | |||
17 | /** |
||
18 | * @var string Tariff name |
||
19 | */ |
||
20 | public $name; |
||
21 | |||
22 | /** |
||
23 | * @var int Parent tariff ID |
||
24 | */ |
||
25 | public $parent_id; |
||
26 | /** @var Tariff */ |
||
27 | public $baseTariff; |
||
28 | /** @var Tariff[] */ |
||
29 | public $baseTariffs; |
||
30 | /** @var Tariff */ |
||
31 | protected $tariff; |
||
32 | /** @var Resource[] */ |
||
33 | protected $_resources; |
||
34 | |||
35 | public function init() |
||
36 | { |
||
37 | $this->initTariff(); |
||
38 | } |
||
39 | |||
40 | protected function initTariff() |
||
41 | { |
||
42 | $this->selectBaseTariff(); |
||
43 | $this->ensureTariff(); |
||
44 | $this->ensureScenario(); |
||
45 | } |
||
46 | |||
47 | protected function ensureTariff() |
||
55 | |||
56 | protected function ensureScenario() |
||
62 | |||
63 | protected function setDefaultTariff() |
||
64 | { |
||
69 | |||
70 | /** @inheritdoc */ |
||
71 | public function rules() |
||
80 | |||
81 | /** @inheritdoc */ |
||
82 | public function fields() |
||
88 | |||
89 | /** @inheritdoc */ |
||
90 | public function attributes() |
||
98 | |||
99 | public function getResources() |
||
103 | |||
104 | /** |
||
105 | * @param array $resources |
||
106 | * @throws InvalidConfigException when not implemented |
||
107 | */ |
||
108 | public function setResources($resources) |
||
112 | |||
113 | public function getResourceTypes() |
||
117 | |||
118 | public function attributeLabels() |
||
127 | |||
128 | /** |
||
129 | * @param array $data to be loaded |
||
130 | * @return bool |
||
131 | * @throws InvalidConfigException when not implemented |
||
132 | */ |
||
133 | public function load($data) |
||
137 | |||
138 | public function selectBaseTariff() |
||
162 | |||
163 | public function getBaseTariffsList() |
||
170 | |||
171 | public function insert($runValidation = true, $attributes = null, $options = []) |
||
175 | |||
176 | public function update($runValidation = true, $attributes = null, $options = []) |
||
180 | |||
181 | /** |
||
182 | * @return Tariff |
||
183 | */ |
||
184 | public function getTariff() |
||
188 | |||
189 | public function setTariff($tariff) |
||
202 | } |
||
203 |
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.