public function init() { parent::init(); if ($this->modelClass === null) { $this->modelClass = Region::className(); } }
/** * @return \yii\db\ActiveQuery */ public function getRegions() { return $this->hasMany(Region::className(), ['country_id' => 'id'])->orderBy(['name' => SORT_ASC]); }
/** * @return \yii\db\ActiveQuery */ public function getRegion() { return $this->hasOne(Region::className(), ['id' => 'region_id']); }