/** * @return \yii\db\ActiveQuery */ public function getLocation() { return $this->hasOne(Location::className(), ['id' => 'location_id']); }
/** * @return \yii\db\ActiveQuery */ public function getUpper() { return $this->hasMany(Location::className(), ['id' => 'upper_id'])->via('locationLinksUpper')->from(['upper' => static::tableName()]); }