Checks that the value provided in a field exists as the primary key of another table.
$_fields
protected array
$_options
protected array
$_repository
protected array
__construct( string|array $fields , object|string $repository , array $options [] )
Constructor.
Available option for $options is 'allowNullableNulls' flag. Set to true to accept composite foreign keys where one or more nullable columns are null.
$fields
$repository
The repository where the field will be looked for, or the association name for the repository.
$options
optional [] __invoke( Cake\Datasource\EntityInterface $entity , array $options )
Performs the existence check
Cake\Datasource\EntityInterface
$entity
$options
Options passed to the check, where the repository
key is required.
_fieldsAreNull( Cake\Datasource\EntityInterface $entity , Cake\ORM\Table $source )
Checks whether or not the given entity fields are nullable and null.
Cake\Datasource\EntityInterface
$entity
Cake\ORM\Table
$source
© 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.ExistsIn.html