1 | <?php |
||
11 | abstract class AbstractTariffForm extends \yii\base\Model |
||
12 | { |
||
13 | /** |
||
14 | * @var int Tariff ID |
||
15 | */ |
||
16 | public $id; |
||
17 | |||
18 | /** |
||
19 | * @var string Tariff name |
||
20 | */ |
||
21 | public $name; |
||
22 | |||
23 | /** |
||
24 | * @var int Parent tariff ID |
||
25 | */ |
||
26 | public $parent_id; |
||
27 | |||
28 | /** |
||
29 | * @var Tariff[] array of available base tariffs |
||
30 | */ |
||
31 | public $baseTariffs; |
||
32 | |||
33 | /** |
||
34 | * @var Tariff the selected base tariff |
||
35 | */ |
||
36 | public $baseTariff; |
||
37 | |||
38 | /** |
||
39 | * @var Tariff |
||
40 | */ |
||
41 | protected $tariff; |
||
42 | |||
43 | /** |
||
44 | * @var \hipanel\modules\finance\models\Resource[] |
||
45 | */ |
||
46 | protected $_resources; |
||
47 | |||
48 | /** |
||
49 | * @inheritdoc |
||
50 | */ |
||
51 | public function init() |
||
59 | |||
60 | /** |
||
61 | * Initializes tariff |
||
62 | * @void |
||
63 | */ |
||
64 | protected function initTariff() |
||
70 | |||
71 | /** |
||
72 | * Ensures that [[tariff]] is set. |
||
73 | * Otherwise calls [[setDefaultTariff()]] |
||
74 | * @return bool |
||
75 | */ |
||
76 | protected function ensureTariff() |
||
84 | |||
85 | protected function ensureScenario() |
||
91 | |||
92 | /** |
||
93 | * Sets default tariff |
||
94 | * |
||
95 | * @return bool |
||
96 | */ |
||
97 | protected function setDefaultTariff() |
||
107 | |||
108 | /** @inheritdoc */ |
||
109 | public function rules() |
||
118 | |||
119 | /** @inheritdoc */ |
||
120 | public function fields() |
||
126 | |||
127 | /** @inheritdoc */ |
||
128 | public function attributes() |
||
136 | |||
137 | /** |
||
138 | * @return \hipanel\modules\finance\models\Resource[] |
||
139 | */ |
||
140 | public function getResources() |
||
144 | |||
145 | /** |
||
146 | * @param \hipanel\modules\finance\models\Resource[] $resources |
||
147 | * @throws InvalidConfigException when not implemented |
||
148 | */ |
||
149 | public function setResources($resources) |
||
153 | |||
154 | /** |
||
155 | * @return array |
||
156 | */ |
||
157 | public function getResourceTypes() |
||
161 | |||
162 | /** |
||
163 | * @return array |
||
164 | */ |
||
165 | public function attributeLabels() |
||
174 | |||
175 | /** |
||
176 | * @param array $data to be loaded |
||
177 | * @param null $formName |
||
178 | * @return bool |
||
179 | * @throws InvalidConfigException when not implemented |
||
180 | */ |
||
181 | public function load($data, $formName = null) |
||
185 | |||
186 | /** |
||
187 | * Selects one of [[baseTariffs]] and puts it to [[baseTariff]] |
||
188 | * |
||
189 | * @return bool |
||
190 | */ |
||
191 | public function selectBaseTariff() |
||
215 | |||
216 | /** |
||
217 | * Builds key-value array of [[baseTariffs]] |
||
218 | * - key: tariff id |
||
219 | * - value: tariff name |
||
220 | * |
||
221 | * @return array |
||
222 | */ |
||
223 | public function getBaseTariffsList() |
||
230 | |||
231 | public function insert($runValidation = true) |
||
235 | |||
236 | public function update($runValidation = true) |
||
240 | |||
241 | /** |
||
242 | * @return Tariff |
||
243 | */ |
||
244 | public function getTariff() |
||
248 | |||
249 | /** |
||
250 | * Sets [[tariff]] |
||
251 | * |
||
252 | * @param Tariff $tariff |
||
253 | * @return bool |
||
254 | */ |
||
255 | public function setTariff($tariff) |
||
268 | |||
269 | public function getPrimaryKey() |
||
273 | |||
274 | /** |
||
275 | * @var TariffCalculator |
||
276 | */ |
||
277 | protected $_calculator; |
||
278 | |||
279 | /** |
||
280 | * Creates [[TariffCalculator]] object for the [[tariff]] |
||
281 | * |
||
282 | * @return TariffCalculator |
||
283 | */ |
||
284 | protected function calculator() |
||
294 | |||
295 | /** |
||
296 | * @return \hipanel\modules\finance\models\Value |
||
297 | */ |
||
298 | public function calculation() |
||
302 | |||
303 | /** |
||
304 | * @var TariffCalculator |
||
305 | */ |
||
306 | protected $_baseCalculator; |
||
307 | |||
308 | /** |
||
309 | * Creates [[TariffCalculator]] object for the [[baseTariff]] |
||
310 | * |
||
311 | * @return TariffCalculator |
||
312 | */ |
||
313 | protected function baseCalculator() |
||
323 | |||
324 | /** |
||
325 | * @return \hipanel\modules\finance\models\Value |
||
326 | */ |
||
327 | public function baseCalculation() |
||
331 | } |
||
332 |
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.