Checks that a list of fields from an entity are unique in the table
__construct( array $fields , array $options [] )
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.$fields
$options
optional [] __invoke( Cake\Datasource\EntityInterface $entity , array $options )
Performs the uniqueness check
Cake\Datasource\EntityInterface
$entity
The entity from where to extract the fields where the repository
key is required.
$options
_alias( string $alias , array $conditions , boolean $multipleNulls )
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
$alias
$conditions
$multipleNulls
© 2005–2017 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/3.4/class-Cake.ORM.Rule.IsUnique.html