You are here

function language_hierarchy_get_children in Language Hierarchy 7

Return children of the language provided

Parameters

$langcode:

Return value

array() Array with children languages

2 calls to language_hierarchy_get_children()
language_hierarchy_get_descendants in ./language_hierarchy.module
Returns tree of descendants for the provided language.
_language_hierarchy_language_list_descendants in ./language_hierarchy.module
Recursion helper function that populates language_list in hierarchical order
2 string references to 'language_hierarchy_get_children'
language_hierarchy_form_submit in ./language_hierarchy_form.inc
Submit callback for the language_hierarchy_form form.
language_hierarchy_language_add_form_submit_callback in ./language_hierarchy.module
An additional submission callback for the add predefined language form.

File

./language_hierarchy.module, line 332

Code

function language_hierarchy_get_children($langcode) {
  $children =& drupal_static(__FUNCTION__);
  if (!isset($children[$langcode])) {
    $children[$langcode] = db_select('languages', 'l')
      ->fields('l')
      ->condition('parent', $langcode)
      ->orderBy('weight', 'ASC')
      ->orderBy('name', 'ASC')
      ->execute()
      ->fetchAllAssoc('language');
  }
  return $children[$langcode];
}