private function LocaleHierarchy::offsetBuild in Language Hierarchy 7
2 calls to LocaleHierarchy::offsetBuild()
- LocaleHierarchy::offsetExists in includes/
LocaleHierarchy.class.inc - LocaleHierarchy::offsetGet in includes/
LocaleHierarchy.class.inc
File
- includes/
LocaleHierarchy.class.inc, line 50 - Definition of LocaleHierarchy.
Class
- LocaleHierarchy
- Class LocaleHierarchy.
Code
private function offsetBuild($offset) {
/**
* WARNING!
* On some rare occasions when drupal is not fully bootstrapped
* the function language_hierarchy_get_ancestors might not be available.
* This may happen on some administration pages so it should be
* safe to just skip all defined fallbacks.
*/
if ($this->candidates === NULL && function_exists('language_hierarchy_get_ancestors')) {
drupal_static_reset('language_list');
$this->candidates = array_keys(language_hierarchy_get_ancestors($this->langcode));
}
if (!isset($this->cache[$offset])) {
$this->cache[$offset] = new LocaleContextHierarchy($this->langcode, $this->candidates, $offset);
}
}