Add Profile::mainGrade() that maps main education to a grade usable
authorFlorent Bruneau <florent.bruneau@polytechnique.org>
Sun, 30 May 2010 07:13:41 +0000 (09:13 +0200)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Sun, 30 May 2010 07:13:41 +0000 (09:13 +0200)
with UserFilter's conditions.

Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
classes/profile.php

index de46ff5..7c73903 100644 (file)
@@ -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()) {