cphalcon
cphalcon copied to clipboard
[NFR] Add "where" condition to Validator Uniqueness
Can we specify more conditions that will be added as "where" clauses to the query:
$this->validate(new Uniqueness(array(
'field' => 'email',
'condition'=>'status != "DELETE"'
)));
In the rule above, only rows with status not deleted would be included in the unique check.
If the Uniqueness validator does not allow that, It is possible to define a new validator class e.g.
class UniquenessAnd extends Uniqueness{
}
And add and implement the extended options there.
There is except option which is solving this i think in phalcon 3.