/** * Связь с регионами * @return \yii\db\ActiveQuery */ public function getRegions() { return $this->hasMany(Region::className(), ["country_id" => "id"])->published(); }
/** * @return \yii\db\ActiveQuery */ public function getRegions() { return $this->hasMany(Region::className(), ['pais_id' => 'id']); }
/** * Связь с регионом * @return \yii\db\ActiveQuery */ public function getRegion() { return $this->hasOne(Region::className(), ["id" => "region_id"]); }
/** * @return \yii\db\ActiveQuery */ public function getRegion() { return $this->hasOne(Region::className(), ['id' => 'region_id']); }