From 06740f527d1cdaab5a2a3511807d8d19aada393b Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Jacob?= Date: Sat, 5 Nov 2011 19:50:33 +0100 Subject: [PATCH] Retrieves extremal promotion for a given education. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Jacob --- classes/profile.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/classes/profile.php b/classes/profile.php index 162f4bd..48d209a 100644 --- a/classes/profile.php +++ b/classes/profile.php @@ -321,6 +321,16 @@ class Profile implements PlExportable } } + // Returns younger/older promotion year for a given education. + static public function extremePromotions($education) + { + return XDB::fetchOneRow("SELECT MIN(pe.promo_year) AS min, MAX(pe.promo_year) AS max + FROM profile_education AS pe + INNER JOIN profile_education_degree_enum AS pede ON (pe.degreeid = pede.id) + WHERE pede.degree = {?} AND FIND_IN_SET('primary', pe.flags)", + $education); + } + /** Print a name with the given formatting: * %s = • for women * %f = firstname -- 2.1.4