Tools\Model\Table\Table::validateUniqueExt PHP Method

validateUniqueExt() public method

This is meant to be used with the validation API and not to be called directly. ### Example: {{{ $validator->add('email', [ 'unique' => ['rule' => 'validateUnique', 'provider' => 'table'] ]) }}} Unique validation can be scoped to the value of another column: {{{ $validator->add('email', [ 'unique' => [ 'rule' => ['validateUnique', ['scope' => 'site_id']], 'provider' => 'table' ] ]); }}} In the above example, the email uniqueness will be scoped to only rows having the same site_id. Scoping will only be used if the scoping field is present in the data to be validated.
public validateUniqueExt ( mixed $value, array $options, array $context = [] ) : boolean
$value mixed The value of column to be checked for uniqueness
$options array The options array, optionally containing the 'scope' key
$context array The validation context as provided by the validation routine
return boolean true if the value is unique
    public function validateUniqueExt($value, array $options, array $context = [])
    {
        $context += $options;
        return parent::validateUnique($value, $context);
    }