On this page
Interface InvalidPropertyInterface
Describes the methods that any class representing a data storage should comply with.
Method Summary
getInvalid() public
Get a list of invalid fields and their data for errors upon validation/patching
getInvalidField() public
Get a single value of an invalid field. Returns null if not set.
setInvalid() public
Set fields as invalid and not patchable into the entity.
setInvalidField() public
Sets a field as invalid and not patchable into the entity.
Method Detail
getInvalid() public
getInvalid(): array
Get a list of invalid fields and their data for errors upon validation/patching
Returns
array
getInvalidField() public
getInvalidField(string $field): mixed|null
Get a single value of an invalid field. Returns null if not set.
Parameters
string
$field-
The name of the field.
Returns
mixed|null
setInvalid() public
setInvalid(array<string, mixed> $fields, bool $overwrite = false): $this
Set fields as invalid and not patchable into the entity.
This is useful for batch operations when one needs to get the original value for an error message after patching. This value could not be patched into the entity and is simply copied into the _invalid property for debugging purposes or to be able to log it away.
Parameters
array<string, mixed>
$fields-
The values to set.
bool
$overwrite optional-
Whether to overwrite pre-existing values for $field.
Returns
$this
setInvalidField() public
setInvalidField(string $field, mixed $value): $this
Sets a field as invalid and not patchable into the entity.
Parameters
string
$field-
The value to set.
mixed
$value-
The invalid value to be set for $field.
Returns
$this
© 2005–present The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
https://api.cakephp.org/4.4/interface-Cake.Datasource.InvalidPropertyInterface.html