Abstract constructor for all validators A validator should accept following parameters:
- nothing f.e. Validator()
- one or multiple scalar values f.e. Validator($first, $second, $third)
- an array f.e. Validator(array($first => ‘first’, $second => ‘second’, $third => ‘third’))
- an instance of Traversable f.e. Validator($config_instance)
| Parameters: | array|Traversable – |
|---|
Returns an option
| Parameters: | string – Option to be returned |
|---|---|
| Return type: | mixed Returned option |
| Throws : | ExceptionInvalidArgumentException |
Returns all available options
| Return type: | array Array with all available options |
|---|
Sets one or multiple options
| Parameters: | array|Traversable – Options to set |
|---|---|
| Throws ExceptionInvalidArgumentException: | |
| If $options is not an array or Traversable | |
| Return type: | AbstractValidator Provides fluid interface |
Returns array of validation failure messages
| Return type: | array |
|---|
Returns an array of the names of variables that are used in constructing validation failure messages
| Return type: | array |
|---|
Returns the message templates from the validator
| Return type: | array |
|---|
Sets the validation failure message template for a particular key
| Parameters: |
|
|---|---|
| Return type: | AbstractValidator Provides a fluent interface |
| Throws : | ExceptionInvalidArgumentException |
Sets validation failure message templates given as an array, where the array keys are the message keys, and the array values are the message template strings.
| Parameters: | array – |
|---|---|
| Return type: | AbstractValidator |
Magic function returns the value of the requested property, if and only if it is the value or a message variable.
| Parameters: | string – |
|---|---|
| Return type: | mixed |
| Throws : | ExceptionInvalidArgumentException |
Constructs and returns a validation failure message with the given message key and value.
Returns null if and only if $messageKey does not correspond to an existing template.
If a translator is available and a translation exists for $messageKey, the translation will be used.
| Parameters: |
|
|---|---|
| Return type: | string |
@param string $messageKey
| Parameters: | string – OPTIONAL |
|---|---|
| Return type: | void |
Returns the validation value
| Return type: | mixed Value to be validated |
|---|
Sets the value to be validated and clears the messages and errors arrays
| Parameters: | mixed – |
|---|---|
| Return type: | void |
Set flag indicating whether or not value should be obfuscated in messages
| Parameters: | bool – |
|---|---|
| Return type: | AbstractValidator |
Retrieve flag indicating whether or not value should be obfuscated in messages
| Return type: | bool |
|---|
Set translation object
| Parameters: |
|
|---|---|
| Return type: | AbstractValidator |
| Throws : | ExceptionInvalidArgumentException |
Does this validator have its own specific translator?
| Return type: | bool |
|---|
Set translation text domain
| Parameters: | string – |
|---|---|
| Return type: | AbstractValidator |
Return the translation text domain
| Return type: | string |
|---|
Set default translation object for all validate objects
| Parameters: |
|
|---|---|
| Return type: | void |
| Throws : | ExceptionInvalidArgumentException |
Get default translation object for all validate objects
| Return type: | Translator|null |
|---|
Is there a default translation object set?
| Return type: | bool |
|---|
Set default translation text domain for all validate objects
| Parameters: | string – |
|---|---|
| Return type: | void |
Get default translation text domain for all validate objects
| Return type: | string |
|---|
Indicate whether or not translation should be enabled
| Parameters: | bool – |
|---|---|
| Return type: | AbstractValidator |
Returns the maximum allowed message length
| Return type: | integer |
|---|