Deletes all references to sectors as they have been replaced by jobterms.
[platal.git] / classes / direnum.php
1 <?php
2 /***************************************************************************
3 * Copyright (C) 2003-2010 Polytechnique.org *
4 * http://opensource.polytechnique.org/ *
5 * *
6 * This program is free software; you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License as published by *
8 * the Free Software Foundation; either version 2 of the License, or *
9 * (at your option) any later version. *
10 * *
11 * This program is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 * GNU General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU General Public License *
17 * along with this program; if not, write to the Free Software *
18 * Foundation, Inc., *
19 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
20 ***************************************************************************/
21
22 // {{{ class DirEnum
23 /** This class stores all data for the different kinds of fields.
24 * It is only a dispatcher for the various DirEnum_XXX classes.
25 */
26 class DirEnum
27 {
28 /** Name of availables Enumerations
29 * Each of these consts contains the basename of the class (its full name
30 * being DE_$basename).
31 */
32 const NAMETYPES = 'nametypes';
33 const NAMES = 'names';
34
35 const BINETS = 'binets';
36 const GROUPESX = 'groupesx';
37 const SECTIONS = 'sections';
38
39 const EDUSCHOOLS = 'educationschools';
40 const EDUDEGREES = 'educationdegrees';
41 const EDUFIELDS = 'educationfields';
42
43 const CORPS = 'corps';
44 const CORPSRANKS = 'corpsranks';
45
46 const NATIONALITIES = 'nationalities';
47 const COUNTRIES = 'countries';
48 const ADMINAREAS = 'adminareas';
49 const LOCALITIES = 'localities';
50
51 const COMPANIES = 'companies';
52 const JOBDESCRIPTION = 'jobdescription';
53 const JOBTERMS = 'jobterms';
54
55 const NETWORKS = 'networking';
56
57 const MEDALS = 'medals';
58
59 static private $enumerations = array();
60
61 static private function init($type)
62 {
63 if (Platal::globals()->cacheEnabled() && S::has('__DE_' . $type)) {
64 self::$enumerations[$type] = S::v('__DE_' . $type);
65 } else {
66 $cls = "DE_" . ucfirst($type);
67 $obj = new $cls();
68 self::$enumerations[$type] = $obj;
69 if (Platal::globals()->cacheEnabled()
70 && $obj->capabilities & DirEnumeration::SAVE_IN_SESSION) {
71 S::set('__DE_' . $type, $obj);
72 }
73 }
74 }
75
76 /** Retrieves all options for a given type
77 * @param $type Type of enum for which options are requested
78 * @return Array of the results
79 */
80 static public function getOptions($type)
81 {
82 if (!array_key_exists($type, self::$enumerations)) {
83 self::init($type);
84 }
85 $obj = self::$enumerations[$type];
86 if ($obj->capabilities & DirEnumeration::HAS_OPTIONS) {
87 return call_user_func(array($obj, 'getOptions'));
88 } else {
89 return array();
90 }
91 }
92
93 /** Retrieves all options for a given type
94 * @param $type Type of enum for which options are requested
95 * @return PlIterator over the results
96 */
97 static public function getOptionsIter($type)
98 {
99 if (!array_key_exists($type, self::$enumerations)) {
100 self::init($type);
101 }
102 $obj = self::$enumerations[$type];
103 $args = func_get_args();
104 array_shift($args);
105 if ($obj->capabilities & DirEnumeration::HAS_OPTIONS) {
106 return call_user_func_array(array($obj, 'getOptionsIter'), $args);
107 } else {
108 return PlIteratorUtils::fromArray(array());
109 }
110 }
111
112 /** Retrieves all options with number of profiles for autocompletion
113 * @param $type Type of enum for which options are requested
114 * @param $text Text to autocomplete
115 * @return PlIterator over the results
116 */
117 static public function getAutoComplete($type, $text)
118 {
119 if (!array_key_exists($type, self::$enumerations)) {
120 self::init($type);
121 }
122 $obj = self::$enumerations[$type];
123 if ($obj->capabilities & DirEnumeration::HAS_AUTOCOMP) {
124 return call_user_func(array($obj, 'getAutoComplete'), $text);
125 } else {
126 return PlIteratorUtils::fromArray(array());
127 }
128 }
129
130 /** Retrieves a list of IDs for a given type
131 * @param $type Type of enum for which IDs are requested
132 * @param $text Text to search in enum valuees
133 * @param $mode Mode of search for those IDs (prefix/suffix/infix)
134 */
135 static public function getIDs($type, $text, $mode = XDB::WILDCARD_EXACT)
136 {
137 if (!array_key_exists($type, self::$enumerations)) {
138 self::init($type);
139 }
140 $obj = self::$enumerations[$type];
141 if ($obj->capabilities & DirEnumeration::HAS_OPTIONS) {
142 return call_user_func(array($obj, 'getIDs'), $text, $mode);
143 } else {
144 return array();
145 }
146 }
147
148 /** Retrieves a single ID for a given type.
149 * @param $type Type of the enum for which an ID is requested
150 * @param $text Text to search in enum values
151 * @param $mode Mode of search of that ID (prefix/suffix/infix/exact)
152 */
153 static public function getID($type, $text, $mode = XDB::WILDCARD_EXACT)
154 {
155 $ids = self::getIDs($type, $text, $mode);
156 return array_shift($ids);
157 }
158 }
159 // }}}
160
161 // {{{ class DirEnumeration
162 abstract class DirEnumeration
163 {
164 const AUTOCOMPLETE_LIMIT = 11;
165
166 const HAS_OPTIONS = 0x001;
167 const HAS_AUTOCOMP = 0x002;
168 const SAVE_IN_SESSION = 0x004;
169
170 public $capabilities = 0x003; // self::HAS_OPTIONS | self::HAS_AUTOCOMP;
171
172 /** An internal array of ID => optionTxt
173 */
174 protected $options = null;
175
176 /** Description of the MySQL storage of the fields
177 */
178 protected $idfield = 'id';
179 protected $valfield = 'text';
180 protected $valfield2 = null;
181 protected $from;
182 protected $join = '';
183 protected $where = '';
184
185 /** Fields for autocompletion
186 */
187 protected $ac_join = ''; // Additional joins
188 protected $ac_where = null; // Additional where
189 protected $ac_beginwith = true; // Whether to search for 'x%' or for '%x%'
190 protected $ac_unique; // Which field is to be taken as unique
191 protected $ac_distinct = true; // Whether we want to keep only distinct valfield value
192 protected $ac_withid = true; // Do we want to fetch id too ?
193
194 protected function _fetchOptions()
195 {
196 if (is_null($this->options)) {
197 $this->loadOptions();
198 }
199 }
200
201 public function getOptions()
202 {
203 $this->_fetchOptions();
204 return $this->options;
205 }
206
207 public function getOptionsIter()
208 {
209 $options = $this->getOptions();
210 $options = self::expandArray($options);
211 return PlIteratorUtils::fromArray($options, 1, true);
212 }
213
214 // {{{ function getIDs
215 /** Retrieves possible IDs for given text
216 * @param $text Text to search for IDs
217 * @param $mode Mode of search (PREFIX, SUFFIX, CONTAINS)
218 * @return An array of matching IDs ; if empty, input should be considered invalid
219 */
220 public function getIDs($text, $mode)
221 {
222 if ($mode == XDB::WILDCARD_EXACT) {
223 $options = $this->getOptions();
224 return array_keys($options, $text);
225 } else {
226 if ($this->where == null) {
227 $where = 'WHERE ';
228 } else {
229 $where = $this->where . ' AND ';
230 }
231 $conds = array();
232 $conds[] = $this->valfield . XDB::formatWildcards($mode, $text);
233 if ($this->valfield2 != null) {
234 $conds[] = $this->valfield2 . XDB::formatWildcards($mode, $text);
235 }
236 $where .= '(' . implode(' OR ', $conds) . ')';
237
238 return XDB::fetchColumn('SELECT ' . $this->idfield . '
239 FROM ' . $this->from . '
240 ' . $this->join . '
241 ' . $where . '
242 GROUP BY ' . $this->idfield);
243 }
244 }
245 // }}}
246
247 /** Builds a list of query parts for searching @$text in @$field :
248 * field LIKE 'text%', field LIKE '% text%', field LIKE '%-text%'
249 */
250 private function mkTests($field, $text)
251 {
252 $tests = array();
253 $tests[] = $field . XDB::formatWildcards(XDB::WILDCARD_PREFIX, $text);
254 if (!$this->ac_beginwith) {
255 $tests[] = $field . XDB::formatWildcards(XDB::WILDCARD_CONTAINS, ' ' . $text);
256 $tests[] = $field . XDB::formatWildcards(XDB::WILDCARD_CONTAINS, '-' . $text);
257 }
258 return $tests;
259 }
260
261 static protected function expandArray(array $tab, $keyname = 'id', $valname = 'field')
262 {
263 $res = array();
264 foreach ($tab as $key => $val) {
265 $res[$key] = array(
266 $keyname => $key,
267 $valname => $val,
268 );
269 }
270 return $res;
271 }
272
273 // {{{ function getAutoComplete
274 public function getAutoComplete($text)
275 {
276 $text = str_replace(array('%', '_'), '', $text);
277
278 if (is_null($this->ac_where) || $this->ac_where == '') {
279 $where = '';
280 } else {
281 $where = $this->ac_where . ' AND ';
282 }
283
284 $tests = $this->mkTests($this->valfield, $text);
285 if (!is_null($this->valfield2)) {
286 $tests = array_merge($tests, $this->mkTests($this->valfield2, $text));
287 }
288
289 $where .= '(' . implode(' OR ', $tests) . ')';
290
291 return XDB::iterator('SELECT ' . $this->valfield . ' AS field'
292 . ($this->ac_distinct ? (', COUNT(DISTINCT ' . $this->ac_unique . ') AS nb') : '')
293 . ($this->ac_withid ? (', ' . $this->idfield . ' AS id') : '') . '
294 FROM ' . $this->from . '
295 ' . $this->ac_join . '
296 WHERE ' . $where . '
297 GROUP BY ' . $this->valfield . '
298 ORDER BY ' . ($this->ac_distinct ? 'nb DESC' : $this->valfield) . '
299 LIMIT ' . self::AUTOCOMPLETE_LIMIT);
300 }
301 // }}}
302
303 // {{{ function loadOptions
304 /** The function used to load options
305 */
306 protected function loadOptions()
307 {
308 $this->options = XDB::fetchAllAssoc('id', 'SELECT ' . $this->valfield . ' AS field,
309 ' . $this->idfield . ' AS id
310 FROM ' . $this->from . '
311 ' . $this->join . '
312 ' . $this->where . '
313 GROUP BY ' . $this->valfield . '
314 ORDER BY ' . $this->valfield);
315 }
316 // }}}
317 }
318 // }}}
319
320 // {{{ class DE_WithSuboption
321 /** A class for DirEnum with possibility to select only suboptions for a given parameter (country, school, ...)
322 */
323 abstract class DE_WithSuboption extends DirEnumeration
324 {
325 protected $optfield;
326
327 protected $suboptions = null;
328
329 protected function loadOptions()
330 {
331 $opts = XDB::fetchAllAssoc('id', 'SELECT ' . $this->valfield . ' AS field,
332 ' . $this->optfield . ' AS subid,
333 ' . $this->idfield . ' AS id
334 FROM ' . $this->from . '
335 ' . $this->join . '
336 ' . $this->where . '
337 GROUP BY ' . $this->valfield . '
338 ORDER BY ' . $this->valfield);
339 $this->options = array();
340 $this->suboptions = array();
341 foreach ($opts as $id => $opt) {
342 $this->options[$id] = $opt['field'];
343 if (!array_key_exists($opt['subid'], $this->suboptions)) {
344 $this->suboptions[$opt['subid']] = array();
345 }
346 $this->suboptions[$opt['subid']][$id] = $opt['field'];
347 }
348 }
349
350 public function getOptions($subid = null)
351 {
352 $this->_fetchOptions();
353 if ($subid == null) {
354 return $this->options;
355 } else if (array_key_exists($subid, $this->suboptions)) {
356 return $this->suboptions[$subid];
357 } else {
358 return array();
359 }
360 }
361
362 public function getOptionsIter($subid = null)
363 {
364 return PlIteratorUtils::fromArray(self::expandArray($this->getOptions($subid)), 1, true);
365 }
366
367 public function getIDs($text, $mode, $subid = null)
368 {
369 if ($mode == XDB::WILDCARD_EXACT) {
370 $options = $this->getOptions($subid);
371 return array_keys($options, $text);
372 } else {
373 if ($this->where == null) {
374 $where = 'WHERE ';
375 } else {
376 $where = $this->where . ' AND ';
377 }
378 if ($subid != null && array_key_exists($subid, $this->suboptions)) {
379 $where .= XDB::format($this->optfield . ' = {?} AND ', $subid);
380 }
381
382 $conds = array();
383 $conds[] = $this->valfield . XDB::formatWildcards($mode, $text);
384 if ($this->valfield2 != null) {
385 $conds[] = $this->valfield2 . XDB::formatWildcards($mode, $text);
386 }
387 $where .= '(' . implode(' OR ', $conds) . ')';
388
389 return XDB::fetchColumn('SELECT ' . $this->idfield . '
390 FROM ' . $this->from . '
391 ' . $this->join . '
392 ' . $where . '
393 GROUP BY ' . $this->idfield);
394 }
395 }
396
397 public function getAutoComplete($text, $subid = null)
398 {
399 $text = str_replace(array('%', '_'), '', $text);
400
401 if (is_null($this->ac_where) || $this->ac_where == '') {
402 $where = '';
403 } else {
404 $where = $this->ac_where . ' AND ';
405 }
406
407 if ($subid != null && array_key_exists($subid, $this->suboptions)) {
408 $where .= XDB::format($this->optfield . ' = {?} AND ', $subid);
409 }
410
411 $tests = $this->mkTests($this->valfield, $text);
412 if (!is_null($this->valfield2)) {
413 $tests = array_merge($tests, $this->mkTests($this->valfield2, $text));
414 }
415
416 $where .= '(' . implode(' OR ', $tests) . ')';
417
418 return XDB::iterator('SELECT ' . $this->valfield . ' AS field'
419 . ($this->ac_distinct ? (', COUNT(DISTINCT ' . $this->ac_unique . ') AS nb') : '')
420 . ($this->ac_withid ? (', ' . $this->idfield . ' AS id') : '') . '
421 FROM ' . $this->from . '
422 ' . $this->ac_join . '
423 WHERE ' . $where . '
424 GROUP BY ' . $this->valfield . '
425 ORDER BY ' . ($this->ac_distinct ? 'nb DESC' : $this->valfield) . '
426 LIMIT ' . self::AUTOCOMPLETE_LIMIT);
427 }
428 }
429 // }}}
430
431 // {{{ class DE_NameTypes
432 // returns 'system' names ('lastname', 'lastname_marital', ...)
433 class DE_NameTypes extends DirEnumeration
434 {
435 public $capabilities = 0x005; // self::HAS_OPTIONS | self::SAVE_IN_SESSION;
436
437 protected $from = 'profile_name_enum';
438 protected $valfield = 'type';
439 }
440 // }}}
441
442 // {{{ class DE_Names
443 // returns 'system' names ('lastname', 'lastname_marital', ...)
444 class DE_Names extends DirEnumeration
445 {
446 public $capabilities = 0x005; // self::HAS_OPTIONS | self::SAVE_IN_SESSION;
447
448 protected $from = 'profile_name_enum';
449 protected $idfield = 'type';
450 protected $valfield = 'name';
451 }
452 // }}}
453
454 /** GROUPS
455 */
456 // {{{ class DE_Binets
457 class DE_Binets extends DirEnumeration
458 {
459 protected $from = 'profile_binet_enum';
460
461 protected $ac_join = 'INNER JOIN profile_binets ON (profile_binet_enum.id = profile_binets.binet_id)';
462 protected $ac_unique = 'profile_binets.pid';
463 }
464 // }}}
465
466 // {{{ class DE_Sections
467 class DE_Sections extends DirEnumeration
468 {
469 protected $from = 'profile_section_enum';
470
471 protected $ac_join = 'INNER JOIN profiles ON (profiles.section = profile_section_enum.id)';
472 protected $ac_unique = 'profiles.pid';
473 }
474 // }}}
475
476 // {{{ class DE_GroupesX
477 class DE_GroupesX extends DirEnumeration
478 {
479 protected $idfield = 'groups.id';
480 protected $valfield = 'groups.nom';
481 protected $valfield2 = 'groups.diminutif';
482 protected $from = 'groups';
483 protected $where = 'WHERE (cat = \'GroupesX\' OR cat = \'Institutions\') AND pub = \'public\'';
484
485 protected $ac_join = "INNER JOIN group_members ON (groups.id = group_members.asso_id
486 AND (groups.cat = 'GroupesX' OR groups.cat = 'Institutions')
487 AND groups.pub = 'public')";
488 protected $ac_unique = 'group_members.uid';
489 }
490 // }}}
491
492 /** EDUCATION
493 */
494 // {{{ class DE_EducationSchools
495 class DE_EducationSchools extends DirEnumeration
496 {
497 protected $idfield = 'profile_education_enum.id';
498 protected $valfield = 'profile_education_enum.name';
499 protected $valfield2 = 'profile_education_enum.abbreviation';
500 protected $from = 'profile_education_enum';
501
502 protected $ac_join = 'INNER JOIN profile_education ON (profile_education.eduid = profile_education_enum.id)';
503 protected $ac_unique = 'profile_education.pid';
504 }
505 // }}}
506
507 // {{{ class DE_EducationDegrees
508 class DE_EducationDegrees extends DirEnumeration
509 {
510 public $capabilities = self::HAS_OPTIONS;
511
512 protected $idfield = 'profile_education_degree.degreeid';
513 protected $optfield = 'profile_education_degree.eduid';
514 protected $valfield = 'profile_education_degree_enum.degree';
515 protected $from = 'profile_education_degree_enum';
516 protected $join = 'INNER JOIN profile_education_degree ON (profile_education_degree.degreeid = profile_education_degree_enum.id)';
517
518 }
519 // }}}
520
521 // {{{ class DE_EducationFields
522 class DE_EducationFields extends DirEnumeration
523 {
524 protected $valfield = 'profile_education_field_enum.field';
525 protected $from = 'profile_education_field_enum';
526
527 protected $ac_join = 'INNER JOIN profile_education ON (profile_education.fieldid = profile_education_field_enum.id)';
528 protected $ac_unique = 'profile_education.pid';
529 }
530 // }}}
531
532 // {{{ class DE_Corps
533 class DE_Corps extends DirEnumeration
534 {
535 protected $idfield = 'profile_corps_enum.id';
536 protected $valfield = 'profile_corps_enum.name';
537 protected $valfield2 = 'profile_corps_enum.abbrev';
538 protected $from = 'profile_corps_enum';
539
540 protected $ac_unique = 'profile_corps.pid';
541 protected $ac_join = 'INNER JOIN profile_corps ON (profile_corps.current_corpsid = profile_corps_enum.id)';
542 }
543 // }}}
544
545 // {{{ class DE_CorpsRanks
546 class DE_CorpsRanks extends DirEnumeration
547 {
548 protected $idfield = 'profile_corps_rank_enum.id';
549 protected $valfield = 'profile_corps_rank_enum.name';
550 protected $valfield2 = 'profile_corps_rank_enum.abbrev';
551 protected $from = 'profile_corps_rank_enum';
552
553 protected $ac_unique = 'profile_corps.pid';
554 protected $ac_join = 'INNER JOIN profile_corps ON (profile_corps.rankid = profile_corps_rank_enum.id)';
555 }
556 // }}}
557
558 /** GEOLOC
559 */
560 // {{{ class DE_Nationalities
561 class DE_Nationalities extends DirEnumeration
562 {
563 protected $idfield = 'geoloc_countries.iso_3166_1_a2';
564 protected $valfield = 'geoloc_countries.nationalityFR';
565 protected $valfield2 = 'geoloc_countries.nationality';
566 protected $from = 'geoloc_countries';
567 protected $join = 'INNER JOIN profiles ON (geoloc_countries.iso_3166_1_a2 IN (profiles.nationality1, profiles.nationality2, profiles.nationality3))';
568
569 protected $ac_join = 'INNER JOIN profiles ON (geoloc_countries.iso_3166_1_a2 IN (profiles.nationality1, profiles.nationality2, profiles.nationality3))';
570 protected $ac_unique = 'profiles.pid';
571 }
572 // }}}
573
574 // {{{ class DE_Countries
575 class DE_Countries extends DirEnumeration
576 {
577 protected $idfield = 'geoloc_countries.iso_3166_1_a2';
578 protected $valfield = 'geoloc_countries.countryFR';
579 protected $valfield2 = 'geoloc_countries.country';
580 protected $from = 'geoloc_countries';
581
582 protected $ac_join = 'INNER JOIN profile_addresses ON (geoloc_countries.iso_3166_1_a2 = profile_addresses.countryId)';
583 protected $ac_unique = 'profile_addresses.pid';
584 }
585 // }}}
586
587 // {{{ class DE_AdminAreas
588 class DE_AdminAreas extends DE_WithSuboption
589 {
590 protected $idfield = 'geoloc_administrativeareas.id';
591 protected $optfield = 'geoloc_administrativeareas.country';
592 protected $valfield = 'geoloc_administrativeareas.name';
593 protected $from = 'geoloc_administrativeareas';
594
595 protected $ac_join = 'INNER JOIN profile_addresses ON (profile_addresses.administrativeAreaId = geoloc_administrativeareas.id)';
596 protected $ac_unique = 'profile_addresses.pid';
597 }
598 // }}}
599
600 // {{{ class DE_Localities
601 class DE_Localities extends DirEnumeration
602 {
603 protected $idfield = 'geoloc_localities.id';
604 protected $valfield = 'geoloc_localities.name';
605 protected $from = 'geoloc_localities';
606
607 protected $ac_join = 'INNER JOIN profile_addresses ON (profile_addresses.localityID = geoloc_localities.id)';
608 protected $ac_unique = 'profile_addresses.pid';
609 }
610 // }}}
611
612 /** JOBS
613 */
614 // {{{ class DE_Companies
615 class DE_Companies extends DirEnumeration
616 {
617 protected $idfield = 'profile_job_enum.id';
618 protected $valfield = 'profile_job_enum.name';
619 protected $valfield2 = 'profile_job_enum.acronym';
620 protected $from = 'profile_job_enum';
621
622 protected $ac_join = 'INNER JOIN profile_job ON (profile_job.jobid = profile_job_enum.id)';
623 protected $ac_unique = 'profile_job.pid';
624 }
625 // }}}
626
627 // {{{ class DE_JobDescription
628 class DE_JobDescription extends DirEnumeration
629 {
630 protected $valfield = 'profile_job.description';
631 protected $from = 'profile_job';
632 protected $idfield = 'profile_job.pid';
633
634 protected $ac_unique = 'profile_job.pid';
635 }
636 // }}}
637
638 // {{{ class DE_JobTerms
639 class DE_JobTerms extends DirEnumeration
640 {
641 // {{{ function getAutoComplete
642 public function getAutoComplete($text)
643 {
644 $tokens = JobTerms::tokenize($text.'%');
645 if (count($tokens) == 0) {
646 return PlIteratorUtils::fromArray(array());
647 }
648 $token_join = JobTerms::token_join_query($tokens, 'e');
649 return XDB::iterator('SELECT e.jtid AS id, e.full_name AS field, COUNT(DISTINCT p.pid) AS nb
650 FROM profile_job_term_enum AS e
651 INNER JOIN profile_job_term_relation AS r ON (r.jtid_1 = e.jtid)
652 INNER JOIN profile_job_term AS p ON (r.jtid_2 = p.jtid)
653 '.$token_join.'
654 GROUP BY e.jtid
655 ORDER BY nb DESC, field
656 LIMIT ' . self::AUTOCOMPLETE_LIMIT);
657 }
658 // }}}
659 }
660 // }}}
661
662 /** NETWORKING
663 */
664 // {{{ class DE_Networking
665 class DE_Networking extends DirEnumeration
666 {
667 protected $idfield = 'profile_networking_enum.nwid';
668 protected $valfield = 'profile_networking_enum.name';
669 protected $from = 'profile_networking_enum';
670
671
672 protected $ac_join = 'INNER JOIN profile_networking ON (profile_networking.nwid = profile_networking_enum.nwid)';
673 protected $ac_unique = 'profile_networking.pid';
674 }
675 // }}}
676
677 /** MEDALS
678 */
679 // {{{ class DE_Medals
680 class DE_Medals extends DirEnumeration
681 {
682 protected $from = 'profile_medal_enum';
683
684 protected $ac_join = 'INNER JOIN profile_medals ON (profile_medals.mid = profile_medal_enum.id)';
685 protected $ac_unique = 'profile_medals.pid';
686 }
687 // }}}
688
689 // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
690 ?>