Checks that a list of fields from an entity are unique in the table
Constructor.
Performs the uniqueness check
Add a model alias to all the keys in a set of conditions.
__construct(array<string> $fields, array<string, mixed> $options = [])
Constructor.
allowMultipleNulls Allows any field to have multiple null values. Defaults to false.array<string> $fields The list of fields to check uniqueness for
array<string, mixed> $options optional The options for unique checks.
__invoke(Cake\Datasource\EntityInterface $entity, array<string, mixed> $options): bool
Performs the uniqueness check
Cake\Datasource\EntityInterface $entity The entity from where to extract the fields where the repository key is required.
array<string, mixed> $options Options passed to the check,
bool_alias(string $alias, array $conditions): array<string, mixed>
Add a model alias to all the keys in a set of conditions.
string $alias The alias to add.
array $conditions The conditions to alias.
array<string, mixed>The list of fields to check
array<string>The unique check options
array<string, mixed>
© 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/class-Cake.ORM.Rule.IsUnique.html