Untitled
By: a guest | Mar 22nd, 2010 | Syntax:
PHP | Size: 0.63 KB | Hits: 115 | Expires: Never
public function configure()
{
$this->validatorSchema->setPostValidator(
new sfValidatorCallback(array('callback' => array($this, 'checkRefund')))
);
}
}
public function checkRefund($validator, $values)
{
if ((!empty($values['result_id']) && $values['result_id'] == 3) && $values['cancel_reason'] == '')
{
$error = new sfValidatorError($validator, 'Vous devez préciser la raison de cette annulation');
// throw an error bound to the password field
throw new sfValidatorErrorSchema($validator, array('cancel_reason' => $error));
}
return $values;
}