Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
return XDB::iterator('SELECT ' . $this->valfield . ' AS field'
. ($this->ac_distinct ? (', COUNT(DISTINCT ' . $this->ac_unique . ') AS nb') : '')
- . ($this->ac_withid ? (', ' . $this->idfield . ' AS id') : '') . '
+ . ($this->ac_withid ? (', ' . $this->from . '.' . $this->idfield . ' AS id') : '') . '
FROM ' . $this->from . '
' . $this->ac_join . '
WHERE ' . $where . '
'nationaliteTxt' => DirEnum::NATIONALITIES,
'schoolTxt' => DirEnum::EDUSCHOOLS,
);
- if (!array_key_exists($enums, $type)) {
+ if (!array_key_exists($type, $enums)) {
exit();
}