3

Zend Db_NoRecordExists docs seem to be limited to checking only one column. Is there a way to check multiple keys when validating an entry? For example, I am allowing the same email address for different cities.

here's my current validator:

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

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

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

thanks!

Oji

David Snabel-Caunt
  • 57,804
  • 13
  • 114
  • 132
user225195
  • 101
  • 1
  • 2
  • 6

1 Answers1

1

noup. u have to write custom validator. try to code App_Validate_Db_Select which will use Zend_Db_Select as input parameter

SMka
  • 3,021
  • 18
  • 14