/** * @return \yii\db\ActiveQuery */ public function getMediafiles() { return $this->hasMany(Mediafile::className(), ['id' => 'mediafile_id'])->viaTable('filemanager_mediafile_tag', ['tag_id' => 'id']); }
/** * @return \yii\db\ActiveQuery */ public function getMediafile() { return $this->hasOne(Mediafile::className(), ['id' => 'mediafile_id']); }