From: Stéphane Jacob Date: Sat, 27 Feb 2010 12:45:33 +0000 (+0100) Subject: Adds function to retrieve the year of the promotion.. X-Git-Tag: xorg/1.0.0~332^2~160 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=845f0a4d5ffdee53858615a917c96d42d920f5b2;p=platal.git Adds function to retrieve the year of the promotion.. Signed-off-by: Stéphane Jacob --- diff --git a/classes/profile.php b/classes/profile.php index 8ebf639..1853fa4 100644 --- a/classes/profile.php +++ b/classes/profile.php @@ -113,6 +113,11 @@ class Profile return $this->promo; } + public function yearpromo() + { + return intval(substr($this->promo, 1, 4)); + } + /** Print a name with the given formatting: * %s = • for women * %f = firstname diff --git a/classes/user.php b/classes/user.php index 17ee862..77bacbf 100644 --- a/classes/user.php +++ b/classes/user.php @@ -277,6 +277,14 @@ class User extends PlUser return $this->profile()->promo(); } + public function yearpromo() + { + if (!$this->hasProfile()) { + return 0; + } + return $this->profile()->yearpromo(); + } + public function firstName() { if (!$this->hasProfile()) {