Skip to content

NotoperatorValidator

NOTOperatorValidator succeeds if the sub-validator failed Parameters: ‘skip_errors’ do not submit errors of child validators to validator manager

class NotoperatorValidator extends OperatorValidator

ExtendsOperatorValidator
Since1.0.0
SourceValidator/NotoperatorValidator.php
MethodDescription
addArgumentResult(ValidationArgument $argument, int $result, ?Validator $validator = null): nullAdds a intermediate result of an validator for the given argument
addFieldResult(Validator $validator, string $fieldname, int $result): voidAdds a validation result for a given field.
addIncident(ValidationIncident $incident): nullAdds an incident to the validation result.
reset(): voidReturns the operator to its initial state for reuse across requests.

public function addArgumentResult(ValidationArgument $argument, int $result, ?Validator $validator = null): null

Adds a intermediate result of an validator for the given argument

The validator (if the error was caused inside a validator).

ParameterTypeDescription
$argumentValidationArgumentThe argument
$resultintThe arguments result.
$validator?ValidatorThe validator (if the error was caused inside a validator).

Returns null

public function addFieldResult(Validator $validator, string $fieldname, int $result): void

Adds a validation result for a given field.

The result of the validation.

ParameterTypeDescription
$validatorValidatorThe validator.
$fieldnamestringThe name of the field which has been validated.
$resultintThe result of the validation.

public function addIncident(ValidationIncident $incident): null

Adds an incident to the validation result.

The incident.

ParameterTypeDescription
$incidentValidationIncidentThe incident.

Returns null

public function reset(): void

Returns the operator to its initial state for reuse across requests.

Resets the inherited state through OperatorValidator::reset(), then drops the single child and puts the result back to SUCCESS, so the validator has to be re-registered before it does anything again.

These come from an ancestor and are documented where they are declared.

MethodDeclared inDescription
addChild()OperatorValidatorAdds new child validator.
appendParameter()ParameterHolderAppend a parameter.
appendParameterByRef()ParameterHolderAppend a parameter by reference.
clearParameters()ParameterHolderClear all parameters associated with this request.
execute()OperatorValidatorExecutes the validator.
getAcceptedParameters()OperatorValidatorReturns the base Validator parameters plus ‘skip_errors’, shared by every operator.
getArguments()ValidatorReturns all arguments which should be validated.
getBase()ValidatorReturns the base path of this validator.
getBaseKeys()ValidatorReturns the “keys” in the path of the base
getChild()OperatorValidatorReturns a named child validator.
getChilds()OperatorValidatorReturns all child validators.
getContext()ValidatorRetrieve the current application context.
getDependencyManager()OperatorValidatorGets parent’s dependency manager.
getFlatParameterNames()ParameterHolderRetrieve an array of flattened parameter names.
getLastKey()ValidatorReturns the last “keys” in the path of the base
getMutatedRequest()ValidatorThe WebRequest this validator ended execute() with.
getName()ValidatorReturns the name of this validator.
getParameter()ParameterHolderRetrieve a parameter.
getParameterNames()ParameterHolderRetrieve an array of parameter names.
getParameters()ParameterHolderRetrieve an array of parameters.
getParentContainer()ValidatorRetrieve the parent container.
getResult()OperatorValidatorReturns the result from the error manager.
hasParameter()ParameterHolderIndicates whether or not a parameter exists.
initialize()ValidatorInitialize this validator.
mapErrorCode()ValidatorConverts string severity codes into integer values (see severity constants) critical -> Validator::CRITICAL error -> Validator::ERROR notice -> Validator::NOTICE none -> Validator::NONE success -> not allowed to be specified by the user.
registerValidators()OperatorValidatorRegisters an array of validators.
removeParameter()ParameterHolderRemove a parameter.
setErrorMessage()ValidatorSets an error message override for the given index (the empty string is the default/generic message).
setParameter()ParameterHolderSet a parameter.
setParameterByRef()ParameterHolderSet a parameter by reference.
setParameters()ParameterHolderSet an array of parameters.
setParametersByRef()ParameterHolderSet an array of parameters by reference.
setParentContainer()ValidatorSets the parent container.
shutdown()OperatorValidatorShutdown method, for shutting down the model etc.