Zend Db_NoRecordExists - checking multiple columns

Zend Db_NoRecordExists docs seem to be limited to checking only one column. Is there a way to check multiple keys while checking a record? For example, I authorize the use of the same email address for different cities.

here is my current validator:

$email->setValidators(array(array('emailAddress'),
                  array('Db_NoRecordExists',false,
                  array(
                    'table'=>'usercities',
                    'field'=>'email',
                  ))));
Table

usercities has two columns: email varchar (64) city_id tinyint

I want to be able to check the combination of these columns. Is it possible? I assume that I will have to create a custom validator. Can this be done without resorting to a custom class?

thanks!

Oji

+3
source share
1 answer

noup. u . App_Validate_Db_Select, Zend_Db_Select

+1

Source: https://habr.com/ru/post/1726139/


All Articles