Class IsUnique
Checks that a list of fields from an entity are unique in the table
Namespace: Cake\ElasticSearch\Rule
Property Summary
-
$_fields protected
arrayThe list of fields to check
Method Summary
-
__construct() public
Constructor.
-
__invoke() public
Performs the uniqueness check
Method Detail
__construct() ¶ public
__construct(array $fields)
Constructor.
Options
filterNullFieldsSet to false to allow keys with null values in the the conditions array.
Parameters
-
array$fields The list of fields to check uniqueness for
__invoke() ¶ public
__invoke(Cake\Datasource\EntityInterface $entity, array $options): bool
Performs the uniqueness check
Parameters
-
Cake\Datasource\EntityInterface$entity The entity from where to extract the fields where the
repositorykey is required.-
array$options Options passed to the check,
Returns
bool