public function __construct($comparison, $grade, $promo) { $this->grade = $grade; $this->comparison = $comparison; $this->promo = $promo; if ($this->grade != UserFilter::DISPLAY) { UserFilter::assertGrade($this->grade); } if ($this->grade == UserFilter::DISPLAY && $this->comparison != '=') { // XXX: we might try to guess the grade from the first char of the promo and forbid only '<= 2004', but allow '<= X2004' Platal::page()->killError("Il n'est pas possible d'appliquer la comparaison '" . $this->comparison . "' aux promotions sans spécifier de formation (X/M/D)"); } }