/** * Retrieves all the Configs assigned to the filtered Apps using AppConnections * as junction table. * * @return \yii\db\ActiveQuery */ public function getApp() { return $this->hasOne(App::className(), ['id' => 'app_id'])->via('appConnections', function ($query) { $query->where(['type' => Config::className()]); }); }
/** * Retrieves all the Configs assigned to the filtered Apps using AppConnections * as junction table. * * @return \yii\db\ActiveQuery */ public function getApp() { return $this->hasOne(App::className(), ['id' => 'app_id'])->via('appConnections', function ($query) { $query->where(['type' => \cyneek\yii2\menu\models\MenuItem::className()]); }); }