From 963bc7fcaa3d52f5d4c91941a261857f91d8579d Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Jacob?= Date: Thu, 25 Mar 2010 15:13:54 +0100 Subject: [PATCH] Adds education related functions to Profile class. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Jacob --- classes/profile.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) 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 -- 2.1.4