Hi, I'm trying to make a custom validator to check if an email is already submited or not. for this I need to execute a query in my custom validator, How can I do that?
use Phalcon\Validation\Validator,
Phalcon\Validation\ValidatorInterface,
Phalcon\Validation\Message;
class Unique extends Validator implements ValidatorInterface
{
public function validate($validator, $attribute)
{
// how to execute "SELECT * FROM myTable" here...
}
}
thanks.