protected function getTextAliasObjectFromData($data, $cacheMinutes = null) { $textAlias = new TextAlias(); $hostLanguagePair = HostLanguageManager::getHostLanguagePair($data['host_language'], $cacheMinutes); $textAlias->id = $data['id']; $textAlias->textValue = Reg::get(ConfigManager::getConfig("Texts")->Objects->TextsValuesManager)->getTextValueById($data['value_id'], $cacheMinutes); $textAlias->language = $hostLanguagePair['language']; $textAlias->host = $hostLanguagePair['host']; $textAlias->hostLanguageId = $data['host_language']; return $textAlias; }
protected function getTextValueObjectFromData($data, $cacheMinutes = null) { $textValue = new TextValue(); $hostLanguagePair = HostLanguageManager::getHostLanguagePair($data['host_language'], $cacheMinutes); $textValue->id = $data['id']; $textValue->text = Reg::get(ConfigManager::getConfig("Texts")->Objects->TextsManager)->getTextById($data['text_id'], $cacheMinutes); $textValue->value = $data['value']; $textValue->language = $hostLanguagePair['language']; $textValue->host = $hostLanguagePair['host']; $textValue->display = $data['display']; $textValue->hostLanguageId = $data['host_language']; return $textValue; }
private static function getConfigDBFromData($row) { $configDB = new ConfigDB(); $configDB->id = $row["id"]; $configDB->name = $row["name"]; $configDB->value = $row["value"]; $configDB->location = explode(":", $row["location"]); $configDB->locationString = $row["location"]; if ($row["host_lang_id"] !== null) { $hostLangPair = HostLanguageManager::getHostLanguagePair($row["host_lang_id"]); $configDB->host = $hostLangPair["host"]; $configDB->language = $hostLangPair["language"]; } if ($row["alias_of"] !== null) { try { $dbConfig = static::getDBConfigById($row["alias_of"]); } catch (RuntimeException $e) { return $configDB; } $configDB->aliasHost = $dbConfig->host; $configDB->aliasLanguage = $dbConfig->language; } return $configDB; }