Hi guys,
Could anyone explain to me how I might validate the uniqueness of a combination of a set of fields? The documentation at https://docs.phalcon.io/en/latest/api/Phalcon_Mvc_Model_Validator_Uniqueness.html mentions the possibility to do this, but it doesn't offer an example.
Would it be as simple as doing something like this (?):
$this->validate(new Uniqueness(array(
'field' => 'id, email'
)));
if ($this->validationHasFailed() == true) {
return false;
}
I'll be trying that one out sometime tonight, but if anyone reads this in the mean time and knows the answer, I'd be grateful if you'd share your knowledge with me. Thanks!