You are here

function variable_parent in Variable 7

Same name and namespace in other branches
  1. 7.2 variable.module \variable_parent()

Map children variables to parent variables

Related topics

1 call to variable_parent()
variable_get_info in ./variable.module
Get variable information

File

./variable.module, line 88
Variable API module

Code

function variable_parent($name) {
  $map =& drupal_static(__FUNCTION__);
  if (!isset($map)) {
    foreach (array_keys(variable_get_info()) as $key) {
      if ($children = variable_children($key)) {
        foreach ($children as $child) {
          $map[$child] = $key;
        }
      }
    }
  }
  return isset($map[$name]) ? $map[$name] : NULL;
}