Conditions | 1 |
Paths | 1 |
Total Lines | 18 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
14 | public function getImages() |
||
15 | { |
||
16 | /** |
||
17 | * @var $object \app\models\BaseObject |
||
18 | * @var $model \app\properties\HasProperties | \yii\db\ActiveRecord |
||
19 | * @return \yii\db\ActiveQueryInterface |
||
20 | */ |
||
21 | $model = $this; |
||
22 | $object = $model->object; |
||
|
|||
23 | return $model->hasMany(Image::className(), ['object_model_id' => 'id'])->andWhere( |
||
24 | ['object_id' => $object->id] |
||
25 | )->addOrderBy( |
||
26 | [ |
||
27 | 'sort_order' => SORT_ASC, |
||
28 | 'id' => SORT_ASC |
||
29 | ] |
||
30 | ); |
||
31 | } |
||
32 | |||
34 |
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.