NotoperatorValidator
NOTOperatorValidator succeeds if the sub-validator failed Parameters: ‘skip_errors’ do not submit errors of child validators to validator manager
Synopsis
Section titled “Synopsis”class NotoperatorValidator extends OperatorValidator
| Extends | OperatorValidator |
| Since | 1.0.0 |
| Source | Validator/NotoperatorValidator.php |
Methods
Section titled “Methods”| Method | Description |
|---|---|
addArgumentResult(ValidationArgument $argument, int $result, ?Validator $validator = null): null | Adds a intermediate result of an validator for the given argument |
addFieldResult(Validator $validator, string $fieldname, int $result): void | Adds a validation result for a given field. |
addIncident(ValidationIncident $incident): null | Adds an incident to the validation result. |
reset(): void | Returns the operator to its initial state for reuse across requests. |
addArgumentResult()
Section titled “addArgumentResult()”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).
| Parameter | Type | Description |
|---|---|---|
$argument | ValidationArgument | The argument |
$result | int | The arguments result. |
$validator | ?Validator | The validator (if the error was caused inside a validator). |
Returns null
addFieldResult()
Section titled “addFieldResult()”public function addFieldResult(Validator $validator, string $fieldname, int $result): void
Adds a validation result for a given field.
The result of the validation.
| Parameter | Type | Description |
|---|---|---|
$validator | Validator | The validator. |
$fieldname | string | The name of the field which has been validated. |
$result | int | The result of the validation. |
addIncident()
Section titled “addIncident()”public function addIncident(ValidationIncident $incident): null
Adds an incident to the validation result.
The incident.
| Parameter | Type | Description |
|---|---|---|
$incident | ValidationIncident | The incident. |
Returns null
reset()
Section titled “reset()”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.
Inherited methods
Section titled “Inherited methods”These come from an ancestor and are documented where they are declared.
| Method | Declared in | Description |
|---|---|---|
addChild() | OperatorValidator | Adds new child validator. |
appendParameter() | ParameterHolder | Append a parameter. |
appendParameterByRef() | ParameterHolder | Append a parameter by reference. |
clearParameters() | ParameterHolder | Clear all parameters associated with this request. |
execute() | OperatorValidator | Executes the validator. |
getAcceptedParameters() | OperatorValidator | Returns the base Validator parameters plus ‘skip_errors’, shared by every operator. |
getArguments() | Validator | Returns all arguments which should be validated. |
getBase() | Validator | Returns the base path of this validator. |
getBaseKeys() | Validator | Returns the “keys” in the path of the base |
getChild() | OperatorValidator | Returns a named child validator. |
getChilds() | OperatorValidator | Returns all child validators. |
getContext() | Validator | Retrieve the current application context. |
getDependencyManager() | OperatorValidator | Gets parent’s dependency manager. |
getFlatParameterNames() | ParameterHolder | Retrieve an array of flattened parameter names. |
getLastKey() | Validator | Returns the last “keys” in the path of the base |
getMutatedRequest() | Validator | The WebRequest this validator ended execute() with. |
getName() | Validator | Returns the name of this validator. |
getParameter() | ParameterHolder | Retrieve a parameter. |
getParameterNames() | ParameterHolder | Retrieve an array of parameter names. |
getParameters() | ParameterHolder | Retrieve an array of parameters. |
getParentContainer() | Validator | Retrieve the parent container. |
getResult() | OperatorValidator | Returns the result from the error manager. |
hasParameter() | ParameterHolder | Indicates whether or not a parameter exists. |
initialize() | Validator | Initialize this validator. |
mapErrorCode() | Validator | Converts 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() | OperatorValidator | Registers an array of validators. |
removeParameter() | ParameterHolder | Remove a parameter. |
setErrorMessage() | Validator | Sets an error message override for the given index (the empty string is the default/generic message). |
setParameter() | ParameterHolder | Set a parameter. |
setParameterByRef() | ParameterHolder | Set a parameter by reference. |
setParameters() | ParameterHolder | Set an array of parameters. |
setParametersByRef() | ParameterHolder | Set an array of parameters by reference. |
setParentContainer() | Validator | Sets the parent container. |
shutdown() | OperatorValidator | Shutdown method, for shutting down the model etc. |