The DataFieldValidator class allows the validation of a single field of a complex DataValues object based on the DataValue's array representation.
More...
The DataFieldValidator class allows the validation of a single field of a complex DataValues object based on the DataValue's array representation.
If the respective field is missing or null, the validation will fail with the code 'missing-field'
- Copyright
- GPL-2.0-or-later
- Author
- Daniel Kinzler
◆ __construct()
Wikibase\Repo\Validators\DataFieldValidator::__construct |
( |
| $field, |
|
|
ValueValidator | $validator ) |
- Parameters
-
string | int | $field | The field on the target DataValue's array representation to check |
ValueValidator | $validator | The validator to apply to the given field |
- Exceptions
-
◆ setOptions()
Wikibase\Repo\Validators\DataFieldValidator::setOptions |
( |
array | $options | ) |
|
- See also
- ValueValidator::setOptions()
- Parameters
-
◆ validate()
Wikibase\Repo\Validators\DataFieldValidator::validate |
( |
| $data | ) |
|
- See also
- ValueValidator::validate()
- Parameters
-
array | $data | The data array to validate |
- Returns
- Result
- Exceptions
-
◆ $field
Wikibase\Repo\Validators\DataFieldValidator::$field |
|
private |
◆ $validator
Wikibase\Repo\Validators\DataFieldValidator::$validator |
|
private |
The documentation for this class was generated from the following file: