+ } else {
+ $missing_full_names = array();
+ foreach ($value as &$term) if (empty($term['full_name'])) {
+ $missing_full_names[] = $term['jtid'];
+ }
+ if (count($missing_full_names)) {
+ $res = XDB::query('SELECT jtid, full_name
+ FROM profile_job_term_enum
+ WHERE jtid IN {?}',
+ $missing_full_names);
+ $term_id_to_name = $res->fetchAllAssoc('jtid', false);
+ foreach ($value as &$term) {
+ if (empty($term['full_name'])) {
+ $term['full_name'] = $term_id_to_name[$term['jtid']];
+ }
+ }
+ }