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 | |||
27 | /** |
||
28 | * @var Tariff[] array of available base tariffs |
||
29 | */ |
||
30 | public $baseTariffs; |
||
31 | |||
32 | /** |
||
33 | * @var Tariff the selected base tariff |
||
34 | */ |
||
35 | public $baseTariff; |
||
36 | |||
37 | /** |
||
38 | * @var Tariff |
||
39 | */ |
||
40 | protected $tariff; |
||
41 | |||
42 | /** |
||
43 | * @var \hipanel\modules\finance\models\Resource[] |
||
44 | */ |
||
45 | protected $_resources; |
||
46 | |||
47 | /** |
||
48 | * @inheritdoc |
||
49 | */ |
||
50 | public function init() |
||
58 | |||
59 | /** |
||
60 | * Initializes tariff |
||
61 | * @void |
||
62 | */ |
||
63 | protected function initTariff() |
||
69 | |||
70 | /** |
||
71 | * Ensures that [[tariff]] is set. |
||
72 | * Otherwise calls [[setDefaultTariff()]] |
||
73 | * @return bool |
||
74 | */ |
||
75 | protected function ensureTariff() |
||
83 | |||
84 | protected function ensureScenario() |
||
90 | |||
91 | /** |
||
92 | * Sets default tariff |
||
93 | * |
||
94 | * @return bool |
||
95 | */ |
||
96 | protected function setDefaultTariff() |
||
106 | |||
107 | /** @inheritdoc */ |
||
108 | public function rules() |
||
117 | |||
118 | /** @inheritdoc */ |
||
119 | public function fields() |
||
125 | |||
126 | /** @inheritdoc */ |
||
127 | public function attributes() |
||
135 | |||
136 | /** |
||
137 | * @return \hipanel\modules\finance\models\Resource[] |
||
138 | */ |
||
139 | public function getResources() |
||
143 | |||
144 | /** |
||
145 | * @param \hipanel\modules\finance\models\Resource[] $resources |
||
146 | * @throws InvalidConfigException when not implemented |
||
147 | */ |
||
148 | public function setResources($resources) |
||
152 | |||
153 | /** |
||
154 | * @return array |
||
155 | */ |
||
156 | public function getResourceTypes() |
||
160 | |||
161 | /** |
||
162 | * @return array |
||
163 | */ |
||
164 | public function attributeLabels() |
||
173 | |||
174 | /** |
||
175 | * @param array $data to be loaded |
||
176 | * @return bool |
||
177 | * @throws InvalidConfigException when not implemented |
||
178 | */ |
||
179 | public function load($data) |
||
183 | |||
184 | /** |
||
185 | * Selects one of [[baseTariffs]] and puts it to [[baseTariff]] |
||
186 | * |
||
187 | * @return bool |
||
188 | */ |
||
189 | public function selectBaseTariff() |
||
213 | |||
214 | /** |
||
215 | * Builds key-value array of [[baseTariffs]] |
||
216 | * - key: tariff id |
||
217 | * - value: tariff name |
||
218 | * |
||
219 | * @return array |
||
220 | */ |
||
221 | public function getBaseTariffsList() |
||
228 | |||
229 | public function insert($runValidation = true) |
||
233 | |||
234 | public function update($runValidation = true) |
||
238 | |||
239 | /** |
||
240 | * @return Tariff |
||
241 | */ |
||
242 | public function getTariff() |
||
246 | |||
247 | /** |
||
248 | * Sets [[tariff]] |
||
249 | * |
||
250 | * @param Tariff $tariff |
||
251 | * @return bool |
||
252 | */ |
||
253 | public function setTariff($tariff) |
||
266 | |||
267 | public function getPrimaryKey() |
||
271 | } |
||
272 |
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.