ErrorBag
- Full name:
\Qubus\Validation\ErrorBag
Properties
messages
Methods
__construct
Constructor
Parameters:
| Parameter | Type | Description |
|---|---|---|
$messages | array |
add
Add message for given key and rule
Parameters:
| Parameter | Type | Description |
|---|---|---|
$key | string | |
$rule | string | |
$message | string |
count
Get messages count
has
Check given key is existed
Parameters:
| Parameter | Type | Description |
|---|---|---|
$key | string |
first
Get the first value of array
Parameters:
| Parameter | Type | Description |
|---|---|---|
$key | string |
get
Get messages from given key, can be use custom format
Parameters:
| Parameter | Type | Description |
|---|---|---|
$key | string | |
$format | string |
all
Get all messages
Parameters:
| Parameter | Type | Description |
|---|---|---|
$format | string |
firstOfAll
Get the first message from existing keys
Parameters:
| Parameter | Type | Description |
|---|---|---|
$format | string | |
$dotNotation | bool |
toArray
Get plain array messages
parseKey
Parse $key to get the array of $key and $ruleName
Parameters:
| Parameter | Type | Description |
|---|---|---|
$key | string |
isWildcardKey
Check the $key is wildcard
Parameters:
| Parameter | Type | Description |
|---|---|---|
$key | mixed |
filterMessagesForWildcardKey
Filter messages with wildcard key
Parameters:
| Parameter | Type | Description |
|---|---|---|
$key | string | |
$ruleName | mixed|null |
formatMessage
Get formatted message
Parameters:
| Parameter | Type | Description |
|---|---|---|
$message | string | |
$format | string |