From: Florent Bruneau Date: Sun, 30 May 2010 07:13:41 +0000 (+0200) Subject: Add Profile::mainGrade() that maps main education to a grade usable X-Git-Tag: xorg/1.0.0~227 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=02d9dff0ec00ef1aa37b0b8a783e1c770134dd4d;p=platal.git Add Profile::mainGrade() that maps main education to a grade usable with UserFilter's conditions. Signed-off-by: Florent Bruneau --- diff --git a/classes/profile.php b/classes/profile.php index de46ff5..7c73903 100644 --- a/classes/profile.php +++ b/classes/profile.php @@ -204,6 +204,20 @@ class Profile } } + public function mainGrade() + { + switch ($this->mainEducation()) { + case 'X': + return UserFilter::GRADE_ING; + case 'M': + return UserFilter::GRADE_MST; + case 'D': + return UserFilter::GRADE_PHD; + default: + return null; + } + } + public function mainEducationDuration() { switch ($this->mainEducation()) {