From 845f0a4d5ffdee53858615a917c96d42d920f5b2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Jacob?= Date: Sat, 27 Feb 2010 13:45:33 +0100 Subject: [PATCH] Adds function to retrieve the year of the promotion.. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Jacob --- classes/profile.php | 5 +++++ classes/user.php | 8 ++++++++ 2 files changed, 13 insertions(+) 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()) { -- 2.1.4