* being DE_$basename).
*/
const NAMETYPES = 'nametypes';
+ const NAMES = 'names';
const BINETS = 'binets';
const GROUPESX = 'groupesx';
const EDUDEGREES = 'educationdegrees';
const EDUFIELDS = 'educationfields';
+ const CORPS = 'corps';
+ const CORPSRANKS = 'corpsranks';
+
const NATIONALITIES = 'nationalities';
const COUNTRIES = 'countries';
const ADMINAREAS = 'adminareas';
const NETWORKS = 'networking';
+ const MEDALS = 'medals';
+
static private $enumerations = array();
static private function init($type)
self::init($type);
}
$obj = self::$enumerations[$type];
+ $args = func_get_args();
+ array_shift($args);
if ($obj->capabilities & DirEnumeration::HAS_OPTIONS) {
- return call_user_func(array($obj, 'getOptionsIter'));
+ return call_user_func_array(array($obj, 'getOptionsIter'), $args);
} else {
return PlIteratorUtils::fromArray(array());
}
}
// }}}
+ /** Builds a list of query parts for searching @$text in @$field :
+ * field LIKE 'text%', field LIKE '% text%', field LIKE '%-text%'
+ */
private function mkTests($field, $text)
{
$tests = array();
} else if (array_key_exists($subid, $this->suboptions)) {
return $this->suboptions[$subid];
} else {
- return false;
+ return array();
}
}
}
// }}}
+// {{{ class DE_Names
+// returns 'system' names ('lastname', 'lastname_marital', ...)
+class DE_Names extends DirEnumeration
+{
+ public $capabilities = 0x005; // self::HAS_OPTIONS | self::SAVE_IN_SESSION;
+
+ protected $from = 'profile_name_enum';
+ protected $idfield = 'type';
+ protected $valfield = 'name';
+}
+// }}}
+
/** GROUPS
*/
// {{{ class DE_Binets
}
// }}}
+// {{{ 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
// {{{ class DE_Networking
class DE_Networking extends DirEnumeration
{
- protected $idfield = 'profile_networking_enum.network_type';
+ protected $idfield = 'profile_networking_enum.nwid';
protected $valfield = 'profile_networking_enum.name';
protected $from = 'profile_networking_enum';
- protected $ac_join = 'INNER JOIN profile_networking ON (profile_networking.network_type = profile_networking_enum.network_type)';
+ protected $ac_join = 'INNER JOIN profile_networking ON (profile_networking.nwid = profile_networking_enum.nwid)';
protected $ac_unique = 'profile_networking.pid';
}
// }}}
+/** MEDALS
+ */
+// {{{ class DE_Medals
+class DE_Medals extends DirEnumeration
+{
+ protected $from = 'profile_medal_enum';
+
+ protected $ac_join = 'INNER JOIN profile_medals ON (profile_medals.mid = profile_medal_enum.id)';
+ protected $ac_unique = 'profile_medals.pid';
+}
+// }}}
+
// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
?>