[ 'class' => LanguageBehavior::className(), ], 'timestamp' => [ 'class' => TimestampBehavior::className(), ], [ 'class' => ManyToManyBehavior::className(), ], [ 'class' => BitMaskBehavior::className(), 'fields' => [ 'top' => 0, 'new' => 1, 'akcia' => 2, 'exclusive' => 3, ], ], [ 'class' => GalleryBehavior::className(), ], ]; } public function getImages() { $ids = []; $gallery = $this->gallery; if (!empty($gallery)) { $ids = array_filter(json_decode($gallery)); } if (!empty($this->image_id)) { $ids[] = $this->image_id; } $this->imgIds = $ids; return $this->hasMany(Image::className(), [ 'id' => 'imgIds' ]); } }