1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
public function checkEmployes($validator, $values){
//test du nombre de techniciens et d'ingénieurs
if($values["technicians"] + $values["engineers"] > $values["employed"]){
$error = new sfValidatorError($validator, 'Invalide');
// Affichage des erreurs
if($values["technicians"] == 0)
throw new sfValidatorErrorSchema($validator, array('engineers'=>$error));
else if($values["engineers"] == 0)
throw new sfValidatorErrorSchema($validator, array('technicians'=>$error));
else
throw new sfValidatorErrorSchema($validator, array('technicians'=>$error,'engineers'=>$error));
}
} |
Partager