$_fields
$_fields : array
The list of fields to check
Checks that a list of fields from an entity are unique in the table
__construct(array $fields, array $options = array())
Constructor.
allowMultipleNulls
Set to false to disallow multiple null values in
multi-column unique rules. By default this is true
to emulate how SQL UNIQUE
keys work.array | $fields | The list of fields to check uniqueness for |
array | $options | The additional options for this rule. |
__invoke(\Cake\Datasource\EntityInterface $entity, array $options) : boolean
Performs the uniqueness check
\Cake\Datasource\EntityInterface | $entity | The entity from where to extract the fields
where the |
array | $options | Options passed to the check, |
_alias(string $alias, array $conditions, boolean $multipleNulls) : array
Add a model alias to all the keys in a set of conditions.
Null values will be omitted from the generated conditions,
as SQL UNIQUE indexes treat NULL != NULL
string | $alias | The alias to add. |
array | $conditions | The conditions to alias. |
boolean | $multipleNulls | Whether or not to allow multiple nulls. |
Loading…