コード例 #1
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getRegion()
 {
     return $this->hasOne(Region::className(), ['id' => 'region_id']);
 }
コード例 #2
0
ファイル: Country.php プロジェクト: WolfForest/yii2-locations
 /**
  * 
  * @return yii\db\ActiveQuery
  */
 public function getRegion()
 {
     return $this->hasMany(Region::className(), ['country_id' => 'id']);
 }