Property | Type | Description | |
---|---|---|---|
$errors | Properties /// | ||
$mainMessage | |||
$status |
Method | Description | |
---|---|---|
__construct ( array $errors = [], string $mainMessage = '', integer $status ) | Initialize an instance of the {@link Validation} class. | |
addError ( string $messageCode, string | array $field = '*', integer | array $options = [] ) : |
Add an error. | |
errorMessage ( array $error ) : string | Gets the error message from an error. | |
fieldValid ( string $field ) : boolean | Check whether or not a particular field is has errors. | |
getErrorsFlat ( ) : array | Gets all of the errors as a flat array. | |
getMessage ( ) : string | Get the message for this exception. | |
isValid ( ) : boolean | Check whether or not the validation is free of errors. | |
mainMessage ( string | null $value = null ) : |
Gets the main error message for the validation. | |
status ( integer | null $value = null ) : |
Get or set the error status code. |
Method | Description | |
---|---|---|
arraySelect ( array $keys, array $array, mixed $default = null ) : mixed | Select the first non-empty value from an array. |
public addError ( string $messageCode, string | array $field = '*', integer | array $options = [] ) : |
||
$messageCode | string | The message translation code. If you add a message that starts with "@" then no translation will take place. |
$field | string | array | The name of the field to add or an array of fields if the error applies to more than one field. |
$options | integer | array | An array of additional information to add to the error entry or a numeric error code. |
return | Returns $this for fluent calls. |
public static errorMessage ( array $error ) : string | ||
$error | array | The error array. |
return | string | Returns the message from the error. |
public fieldValid ( string $field ) : boolean | ||
$field | string | The name of the field to check for validity. |
return | boolean | Returns true if the field has no errors, false otherwise. |
public getErrorsFlat ( ) : array | ||
return | array | Returns all of the errors. |
public getMessage ( ) : string | ||
return | string | Returns the exception message. |