Class IsUnique

Checks that a list of fields from an entity are unique in the table

Namespace: Cake\ORM\Rule
Located at ORM/Rule/IsUnique.php

Method Detail

__constructsource public

__construct( array $fields )

Constructor.

Parameters

array $fields
The list of fields to check uniqueness for

__invokesource public

__invoke( Cake\Datasource\EntityInterface $entity , array $options )

Performs the uniqueness check

Parameters

Cake\Datasource\EntityInterface $entity
The entity from where to extract the fields
array $options
Options passed to the check, where the repository key is required.

Returns

boolean
bool

_aliassource protected

_alias( string $alias , array $conditions )

Add a model alias to all the keys in a set of conditions.

Parameters

string $alias
The alias to add.
array $conditions
The conditions to alias.

Returns

array
array

Properties summary

$_fieldssource

protected array

The list of fields to check

© 2005–2016 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.
http://api.cakephp.org/3.1/class-Cake.ORM.Rule.IsUnique.html