Validator
- Full name:
\Qubus\Validation\Validator
Properties
translations
validators
allowRuleOverride
useHumanizedKeys
Methods
__construct
Parameters:
| Parameter | Type | Description |
|---|---|---|
$messages | array |
setValidator
Register or override existing validator.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$key | mixed | |
$rule | \Qubus\Validation\Rule |
getValidator
Get validator object from given $key.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$key | mixed |
validate
Validate $inputs.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$inputs | array | |
$rules | array | |
$messages | array |
Throws:
make
Given $inputs, $rules and $messages to make the Validation class instance.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$inputs | array | |
$rules | array | |
$messages | array |
Throws:
__invoke
Magic invoke method to make Rule instance.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$rule | string |
Throws:
registerBaseValidators
Initialize base validators array.
addValidator
Given $ruleName and $rule to add new validator.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$ruleName | string | |
$rule | \Qubus\Validation\Rule |
Throws:
allowRuleOverride
Set rule can allow to be overridden.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$status | bool |
setUseHumanizedKeys
Set this can use humanize keys.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$useHumanizedKeys | bool |
isUsingHumanizedKey
Get $this->useHumanizedKeys value.
Inherited methods
setMessage
Given $key and $message to set message.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$key | mixed | |
$message | mixed |
setMessages
Given $messages and set multiple messages.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$messages | array |
getMessage
Given message from given $key.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$key | string |
getMessages
Get all $messages
setTranslation
Given $key and $translation to set translation
Parameters:
| Parameter | Type | Description |
|---|---|---|
$key | mixed | |
$translation | mixed |
setTranslations
Given $translations and set multiple translations
Parameters:
| Parameter | Type | Description |
|---|---|---|
$translations | array |
getTranslation
Given translation from given $key
Parameters:
| Parameter | Type | Description |
|---|---|---|
$key | string |
getTranslations
Get all $translations