/** * @return \yii\db\ActiveQuery */ public function getCuisine() { return $this->hasOne(Cuisine::className(), ['Id' => 'cuisineId']); }
/** * @return \yii\db\ActiveQuery */ public function getCuisines() { if (isset($this->_cuisines)) { return $this->_cuisines; } else { return $this->hasMany(Cuisine::className(), ['Id' => 'cuisineId'])->via('resMaps'); } /*/ $data = []; foreach($this->resMaps as $model){ if($model->cuisineId){ $data[]=$model->cuisineId; } } return $data; //*/ }