コード例 #1
0
 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;
 }
コード例 #2
0
 protected function customInitAfterObjects()
 {
     $hostLangId = null;
     $configDBFilter = new ConfigDBFilter();
     if (Reg::get('packageMgr')->isPluginLoaded("Language", "HostLanguage")) {
         $hostName = ConfigManager::getConfig("Host", "Host")->Objects->Host;
         $languageName = ConfigManager::getConfig("Language", "Language")->ObjectsIgnored->Language;
         $hostLangId = HostLanguageManager::getHostLanguageId(Reg::get($hostName), Reg::get($languageName));
         $configDBFilter->setCommonOrHostLang($hostLangId);
     }
     ConfigDBManager::initDBConfig($configDBFilter);
 }
コード例 #3
0
 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;
 }
コード例 #4
0
 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;
 }