public function clearErrors($attribute = null) { if ($attribute === null) { $this->_errors = []; } else { unset($this->_errors[$attribute]); } }
/** * @param Event $event event parameter. */ public function afterValidate($event) { if (!$this->getIsNeedValidate()) { $this->owner->clearErrors($this->attribute); } if ($this->owner->hasErrors()) { $this->addAttempt(); } else { $this->removeAttempts(); } }