OroperatorValidator
OROperatorValidator succeeds if at least one sub-validators succeeded Parameters: ‘skip_errors’ do not submit errors of child validators to validator manager ‘break’ break the execution of child validators after first success
Synopsis
Section titled “Synopsis”class OroperatorValidator extends OperatorValidator
| Extends | OperatorValidator |
| Since | 1.0.0 |
| Source | Validator/OroperatorValidator.php |
Methods
Section titled “Methods”| Method | Description |
|---|---|
getAcceptedParameters(): array<int, string> | Returns the base and OperatorValidator parameters plus ‘break’. |
reset(): void | Returns the operator to its initial state for reuse across requests. |
getAcceptedParameters()
Section titled “getAcceptedParameters()”public static function getAcceptedParameters(): array<int, string>
Returns the base and OperatorValidator parameters plus ‘break’.
‘break’ stops the group as soon as one child succeeds instead of running the remaining ones; a CRITICAL child result breaks out regardless of it. ‘skip_errors’ comes from OperatorValidator.
Returns array``<``int``, ``string``> — The accepted parameter names.
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 children 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 |
|---|---|---|
addArgumentResult() | OperatorValidator | Adds a intermediate result of an validator for the given argument. |
addChild() | OperatorValidator | Adds new child validator. |
addFieldResult() | OperatorValidator | Adds a validation result for a given field. |
addIncident() | OperatorValidator | Adds an incident to the validation result. |
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. |
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. |