Add DirEnum for corps/corpsranks
authorRaphaël Barrois <raphael.barrois@polytechnique.org>
Mon, 19 Jul 2010 22:57:33 +0000 (00:57 +0200)
committerRaphaël Barrois <raphael.barrois@polytechnique.org>
Mon, 19 Jul 2010 22:57:33 +0000 (00:57 +0200)
Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org>
classes/direnum.php

index 7dbf40c..c6fbf0d 100644 (file)
@@ -40,6 +40,9 @@ class DirEnum
     const EDUDEGREES     = 'educationdegrees';
     const EDUFIELDS      = 'educationfields';
 
+    const CORPS          = 'corps';
+    const CORPSRANKS     = 'corpsranks';
+
     const NATIONALITIES  = 'nationalities';
     const COUNTRIES      = 'countries';
     const ADMINAREAS     = 'adminareas';
@@ -525,6 +528,32 @@ class DE_EducationFields extends DirEnumeration
 }
 // }}}
 
+// {{{ class DE_Corps
+class DE_Corps extends DirEnumeration
+{
+    protected $idfield   = 'corps_enum.id';
+    protected $valfield  = 'corps_enum.name';
+    protected $valfield2 = 'corps_enum.abbrev';
+    protected $from      = 'corps_enum';
+
+    protected $ac_unique = 'corps.pid';
+    protected $ac_join   = 'INNER JOIN corps ON (corps.current_corpsid = corps_enum.id)';
+}
+// }}}
+
+// {{{ class DE_CorpsRanks
+class DE_CorpsRanks extends DirEnumeration
+{
+    protected $idfield   = 'corps_rank_enum.id';
+    protected $valfield  = 'corps_rank_enum.name';
+    protected $valfield2 = 'corps_rank_enum.abbrev';
+    protected $from      = 'corps_rank_enum';
+
+    protected $ac_unique = 'corps.pid';
+    protected $ac_join   = 'INNER JOIN corps ON (corps.rankid = corps_rank_enum.id)';
+}
+// }}}
+
 /** GEOLOC
  */
 // {{{ class DE_Nationalities