protected function LanguageHierarchyI18nVariableLanguageRealm::getParentKeyVariableRealmController in Language Hierarchy 7
Get the realm controller belonging to the given key.
Note that this result is stored in a instance variable, so it it not safe to call this method with different $key parameters.
Parameters
$key: The key of our parent in the language realm.
Return value
VariableRealmControllerInterface The variable realm controller for the given parent key.
1 call to LanguageHierarchyI18nVariableLanguageRealm::getParentKeyVariableRealmController()
- LanguageHierarchyI18nVariableLanguageRealm::getParentRealmStore in modules/
i18n_variable_hierarchy/ includes/ i18n_variable_hierarchy.class.inc - Get a reference to the parent realm's store.
File
- modules/
i18n_variable_hierarchy/ includes/ i18n_variable_hierarchy.class.inc, line 50 - Variable Realm controller.
Class
- LanguageHierarchyI18nVariableLanguageRealm
- Controller for Language realms, with support for language heirarchy.
Code
protected function getParentKeyVariableRealmController($key) {
if (!isset($this->parentKeyRealmController[$key])) {
$info = variable_realm_info($this->realm_name);
$class = !empty($info['controller class']) ? $info['controller class'] : 'VariableRealmDefaultController';
if ($this->parentKeyRealmController[$key] = class_exists($class) ? new $class($this->realm_name) : FALSE) {
$this->parentKeyRealmController[$key]
->enable($key);
}
}
return $this->parentKeyRealmController[$key];
}