Class Phalcon\Mvc\Model\Validator\Uniqueness

Validates that a field or a combination of a set of fields are not
present more than once in the existing records of the related table

This validator is only for use with Phalcon\Mvc\Collection. If you are using
Phalcon\Mvc\Model, please use the validators provided by Phalcon\Validation.

<?phpusePhalcon\Mvc\Collection;usePhalcon\Mvc\Model\Validator\Uniqueness;classSubscriptorsextendsCollection{publicfunctionvalidation(){$this->validate(newUniqueness(["field"=>"email","message"=>"Value of field 'email' is already present in another record",]));if($this->validationHasFailed()===true){returnfalse;}}}