You are here

function _term_level_groups_add_to_table in Term Level Field 7

Helper function that adds a term to the table structure.

1 call to _term_level_groups_add_to_table()
_term_level_get_groups in ./term_level.module
Returns list of terms, group by their parents or voc.

File

./term_level.module, line 492
Field type for referencing terms with a level to an entity.

Code

function _term_level_groups_add_to_table(&$groups, $term) {
  $term_parent = end($term->parents);
  if (isset($groups['level_2'][$term_parent])) {
    $term_parent = $groups['level_2'][$term_parent]['parent'];
  }
  $groups['terms'][$term_parent][$term->tid] = $term;
}