Using Symfony1, how could I validate one of two fields is being filled in in a form? They are but not required fields but I need the user to fill in one of the two field. This is my attempt so far, but it doesn't work:
$this->setValidator('phone', new sfValidatorAnd(
array(
new sfValidatorSchemaCompare('email', '==', ''),
new sfValidatorSchemaCompare('phone', '==', ''),
),
array(),
array(
'invalid' => 'El e-mail no tiene un formato correcto',
'required' => 'Campo obligatorio',
)
));