true, 'targetClass' => User::className(), 'targetAttribute' => ['employee_id' => 'id']], [['manager_id'], 'exist', 'skipOnError' => true, 'targetClass' => Manager::className(), 'targetAttribute' => ['manager_id' => 'id']], ]; } /** * {@inheritdoc} */ public function attributeLabels() { return [ 'id' => 'ID', 'manager_id' => 'Менеджер', 'employee_id' => 'Работник', ]; } /** * @return ActiveQuery */ public function getUser() { return $this->hasOne(User::className(), ['id' => 'employee_id']); } /** * @return ActiveQuery */ public function getManager() { return $this->hasOne(Manager::className(), ['id' => 'manager_id']); } }