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