protected function afterValidate() { if ($this->disorder_id && $this->finding_id) { $this->addError('disorder_id', 'Cannot set both disorder and finding'); $this->addError('finding_id', 'Cannot set both disorder and finding'); } }