From: Stéphane Jacob Date: Thu, 25 Mar 2010 14:13:54 +0000 (+0100) Subject: Adds education related functions to Profile class. X-Git-Tag: xorg/1.0.0~329 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=963bc7fcaa3d52f5d4c91941a261857f91d8579d;p=platal.git Adds education related functions to Profile class. Signed-off-by: Stéphane Jacob --- diff --git a/classes/profile.php b/classes/profile.php index 96cc71e..a397da7 100644 --- a/classes/profile.php +++ b/classes/profile.php @@ -195,6 +195,25 @@ class Profile return intval(substr($this->promo, 1, 4)); } + public function mainEducation() + { + return $this->promo{0}; + } + + public function mainEducationDuration() + { + switch ($this->mainEducation()) { + case 'X': + return 3; + case 'M': + return 2; + case 'D': + return 3; + default: + return 0; + } + } + /** Print a name with the given formatting: * %s = • for women * %f = firstname