From: Stéphane Jacob Date: Sat, 5 Nov 2011 18:50:33 +0000 (+0100) Subject: Retrieves extremal promotion for a given education. X-Git-Tag: xorg/1.1.4~25 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=06740f527d1cdaab5a2a3511807d8d19aada393b;p=platal.git Retrieves extremal promotion for a given education. Signed-off-by: Stéphane Jacob --- 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