/** * Получаем специалиста (доктора) */ public function getSpecialist() { return $this->hasOne(Specialist::className(), ['id' => 'specialist_id']); }
/** * @return \yii\db\ActiveQuery */ public function getSpecs() { return $this->hasMany(Specialist::className(), ['id' => 'spec_id'])->viaTable('tbl_specialist_has_type', ['spec_type_id' => 'id']); }