Attribute
- Full name:
\Qubus\Validation\Attribute
Properties
rules
key
alias
validation
required
primaryAttribute
otherAttributes
keyIndexes
Methods
__construct
public __construct(\Qubus\Validation\Validation $validation, string $key, string|null $alias = null, array $rules = []): void
Parameters:
| Parameter | Type | Description |
|---|---|---|
$validation | \Qubus\Validation\Validation | |
$key | string | |
$alias | string|null | |
$rules | array |
setPrimaryAttribute
Set the primary attribute.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$primaryAttribute | \Qubus\Validation\Attribute |
setKeyIndexes
Set key indexes.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$keyIndexes | array |
getPrimaryAttribute
Get primary attributes.
setOtherAttributes
Set other attributes.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$otherAttributes | array |
addOtherAttribute
Add other attributes.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$otherAttribute | \Qubus\Validation\Attribute |
getOtherAttributes
Get other attributes.
addRule
Add rule.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$rule | \Qubus\Validation\Rule |
getRule
Get rule.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$ruleKey | string |
getRules
Get rules.
hasRule
Check the $ruleKey has in the rule.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$ruleKey | string |
setRequired
Set required.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$required | bool |
isRequired
Set rule is required.
getKey
Get key.
getKeyIndexes
Get key indexes.
getValue
Get value.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$key | string|null |
Throws:
isArrayAttribute
Get that is array attribute.
isUsingDotNotation
Check this attribute is using dot notation.
resolveSiblingKey
Resolve sibling key.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$key | string |
getHumanizedKey
Get humanize key.
setAlias
Set alias.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$alias | string |
getAlias
Get alias.