/** * @return \yii\db\ActiveQuery */ public function getParent() { return $this->hasOne(NutsCode::className(), ['id' => 'parent_id']); }
/** * @return \yii\db\ActiveQuery */ public function getChildren() { return $this->hasMany(NutsCode::className(), ['id' => 'child_id'])->viaTable('nuts_hierarchy', ['parent_id' => 'id']); }
/** * @return \yii\db\ActiveQuery */ public function getNutsCode() { return $this->hasOne(NutsCode::className(), ['id' => 'nuts_code_id']); }