Add custom error which not reset after validation

@param string $fieldName
@param string $ruleName
@param string $message

@return \Sokil\Mongo\Document
764178
public function triggerError($fieldName, $ruleName, $message)
    {
        $this->triggeredErrors[$fieldName][$ruleName] = $message;
        return $this;
    }
1314614
function ruleRequiredWith($anotherfields, $error_message = null) {
        if (is_array($anotherfields)) {
            $anotherfields = implode(',', $anotherfields);
        }

        return $this->_rule('required_with:' . $anotherfields, $error_message);
    }
195460
public function addValidationError($field, $errorMessage)
    {
        $this->_isValid = false;
        $this->_validationErrors[$field] = $errorMessage;
    }
515496
public function add_rule($name, $value, $rules){
        $this->fieldsState[$name] = array(
			'name'			=> $name,
			'value'			=> $value,
			'rules'			=> explode('|', $rules),
                        'valid'                 => TRUE,
                        'message'               => NULL
        );
    }
430754
public static function validate(array $data, array $rules = [], array $messages = []): array
    {
        $errors = [];

        foreach ($rules as $name => $field_rules) {
            if (isset($data[$name])) {
                $field_value = $data[$name];

                $found_err = self::validateFiled($data, $field_value, self::normalizeRules($field_rules), $messages[$name] ?? []);

                if(\is_array($found_err)){
                    $errors[$name] = $found_err;
                }
            }
        }

        return $errors;
    }
898358
public function addError($message, $severity = Validator\Rule::ERROR,
        array $indexes = []
    ) {
        $rule = new Validator\Rule(
            $this->entity,
            function () {
                return false;
            },
            $message,
            $this->property,
            $severity,
            $this->child
        );
        $rule->setChildFailed($indexes);
        $this->rules[] = $rule;
        return $this;
    }
559525
private function buildErrorMessage(array $errorValues, array &$errors, $funcName, $propertyName)
    {
        $message = \str_replace(':attribute', "'".$propertyName."'", $errors[$funcName]);

        foreach ($errorValues as $key => $value) {
            $message = \str_replace(":{$key}", $value, $message);
        }

        return $message;
    }
26630
protected function fails($fieldname = null) {
		
		$helper = new StringToArray();
		return $helper -> execute($fieldname, null, Message :: getErrors(true));
	}
1085497
protected function _rule($rule, $error_message = null) {
        if (!$this->field) {
            throw new \Exception('Not specified fieldname');
        }
        $this->rules[$this->field][$rule] = $rule;
        if ($error_message) {
            $this->message($rule, $error_message, $this->field);
        }

        return $this;
    }
426271
public static function getMessage($field, $rule) {

		if(false === is_string($field)) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($field)), E_USER_ERROR);
		}

		if(false === is_string($rule)) {
			return trigger_error(sprintf('Argument 2 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($rule)), E_USER_ERROR);
		}

		if(true === isset(static :: $messages[$field][$rule])) {
			return static :: $messages[$field][$rule];
		}
	}
332220
public function message($ruleOrMessage, $message = null)
    {
        if (1 === func_num_args()) {
            $rule = $this->lastRule;
            $message = $ruleOrMessage;
        } else {
            $rule = $ruleOrMessage;
        }

        $this->options['messages'][$this->lastKey][$rule] = $message;

        return $this;
    }
694762
protected function setErrorField($name, $value, $messages, $arrayIndex = null)
    {
        // Loop through all errors
        foreach ($messages as $errorType => $error) {
            // When the validation messages are about an array, they are set in a sub array (validation_errors)
            if (is_numeric($errorType) && is_array($error) && isset($error['validation_errors'])) {
                // Array index is 1 based so deduct one to create 0 based index
                $arrayIndex = ((int) $errorType) - 1;
                $this->setErrorField(
                    $name,
                    isset($value[$arrayIndex]) ? $value[$arrayIndex] : null,
                    $error['validation_errors'],
                    $arrayIndex
                );
            } elseif (is_array($error)) {
                // When there is an array of errors returned, handle them recursively
                $this->setErrorField($name, $value, $error, $arrayIndex);
            } else {
                // Add error field with all information
                $this->errorFields[] = new ErrorField($name, $value, $errorType, $error, $arrayIndex);
            }
        }
    }
565308
public function addRule($field, $rule, $message, $options = array()) {
        if (empty($this->_fields[$field])) {
            throw new InvalidArgumentException(sprintf('Field %s does not exist', $field));
        }

        if (isset($this->_messages[$rule])) {
            $message = $message ?: $this->_messages[$rule];
        } else {
            $this->_messages[$rule] = $message;
        }

        $this->_rules[$field][$rule] = array(
            'message' => $message,
            'options' => (array) $options
        );

        return $this;
    }
1134411
protected function registerError($rule, $key, $message = null)
    {
        if (empty($message)) {
            $message = $this->messages[$rule];
        }

        $this->errors[$key] = sprintf($message, $this->fields[$key]);
    }
435189
def raise_error(self, message='', errors=None, field_name=None):
        
        field_name = field_name if field_name else self.field_name
        raise ValidationError(message, errors=errors, field_name=field_name)
814350
public function setRule($rule, $function, $message = '', $args = array())
    {
        if (!array_key_exists($rule, $this->rules)) {
            $this->rules[$rule] = TRUE;
            if (!array_key_exists($rule, $this->functions)) {
                if (!is_callable($function)) {
                    die('Invalid function for rule: ' . $rule);
                }
                $this->functions[$rule] = $function;
            }
            $this->arguments[$rule] = $args; // Specific arguments for rule

            $this->messages[$rule] = (empty($message)) ? $this->_getDefaultMessage($rule, $args) : $message;
        }
    }
140980
public function error($message = '', $title = '')
    {
        $this->dataCollection->add('message', $message);
        $this->dataCollection->add('title',   $title);

        return $this->render('Error');
    }