InvalidFieldException
extends UserException
in package
The invalid field exception class
This exception is thrown when we try to validate a form field, and it's invalid.
Table of Contents
Properties
- $args : array<string|int, mixed>
- The arguments of this check
- $channel : string
- The log channel
- $domain : string|null
- The translation domain
- $field : string
- The input field name
- $key : string
- The message key
- $type : string|null
- The type
- $value : string|null
- The value that is not valid
Methods
- __construct() : mixed
- Constructor
- __toString() : string
- Get the string representation of this exception
- from() : InvalidFieldException
- Convert an UserException into an InvalidFieldException using other parameters
- getArgs() : array<string|int, mixed>
- Get the field's arguments
- getChannel() : string
- getDomain() : string|null
- Get the domain
- getField() : string
- Get the field
- getKey() : string
- Get the key for this field and message
- getReport() : string
- Get the report from this exception
- getText() : string
- Get the user's message
- getType() : string|null
- Get the type of the field
- getValue() : string
- Get the field's value that is not valid
- removeArgs() : void
- Remove args from this exception, this is required for some tests (generating possible errors)
- setDomain() : void
- Set the domain
Properties
$args
The arguments of this check
protected
array<string|int, mixed>
$args
$channel
The log channel
protected
string
$channel
= LOGFILE_SYSTEM
$domain
The translation domain
protected
string|null
$domain
= null
$field
The input field name
protected
string
$field
$key
The message key
protected
string
$key
$type
The type
protected
string|null
$type
$value
The value that is not valid
protected
string|null
$value
Methods
__construct()
Constructor
public
__construct(string $key, string $field, string|null $value[, string|null $type = null ][, string|null $domain = null ][, array<string|int, mixed>|object|scalar $typeArgs = [] ]) : mixed
Parameters
- $key : string
- $field : string
- $value : string|null
- $type : string|null = null
- $domain : string|null = null
- $typeArgs : array<string|int, mixed>|object|scalar = []
__toString()
Get the string representation of this exception
public
__toString() : string
Return values
stringfrom()
Convert an UserException into an InvalidFieldException using other parameters
public
static from(UserException $e, string $field, string|null $value[, string|null $type = null ][, array<string|int, mixed> $args = [] ]) : InvalidFieldException
Parameters
- $e : UserException
- $field : string
- $value : string|null
- $type : string|null = null
- $args : array<string|int, mixed> = []
Return values
InvalidFieldExceptiongetArgs()
Get the field's arguments
public
getArgs() : array<string|int, mixed>
Return values
array<string|int, mixed>getChannel()
public
getChannel() : string
Return values
stringgetDomain()
Get the domain
public
getDomain() : string|null
Return values
string|nullgetField()
Get the field
public
getField() : string
Return values
stringgetKey()
Get the key for this field and message
public
getKey() : string
Return values
stringgetReport()
Get the report from this exception
public
getReport() : string
Return values
string —The report
getText()
Get the user's message
public
getText() : string
Return values
string —The translated message from this exception
getType()
Get the type of the field
public
getType() : string|null
Return values
string|nullgetValue()
Get the field's value that is not valid
public
getValue() : string
Return values
stringremoveArgs()
Remove args from this exception, this is required for some tests (generating possible errors)
public
removeArgs() : void
setDomain()
Set the domain
public
setDomain(string|null $domain) : void
Parameters
- $domain : string|null
-
The new domain