14 private $cityNames =
null;
15 private $cacheId =
"CSaleYMLocations";
24 private function getData()
26 if($this->cityNames !==
null)
27 return $this->cityNames;
32 if(
false && $cacheManager->read($ttl, $this->cacheId))
34 $cityNames = $cacheManager->get($this->cacheId);
38 $cityNames = $this->loadDataToCache();
39 $cacheManager->set($this->cacheId, $cityNames);
42 $this->cityNames = $cityNames;
50 private function loadDataToCache()
54 $res = \Bitrix\Sale\Location\LocationTable::getList(
array(
56 '=NAME.LANGUAGE_ID' =>
'ru',
57 '=TYPE.CODE' =>
array(
'CITY')
61 'NAME_NAME' =>
'NAME.NAME'
65 $replaceFrom = explode(
',', Loc::getMessage(
'SALE_YML_REPLACE_FROM'));
67 while($loc =
$res->fetch())
69 $result[$loc[
'ID']] = str_replace(
71 Loc::getMessage(
'SALE_YML_REPLACE_TO'),
72 mb_strtolower($loc[
'NAME_NAME'])
90 Loc::getMessage(
'SALE_YML_REPLACE_FROM')
92 Loc::getMessage(
'SALE_YML_REPLACE_TO'),
93 mb_strtolower($cityName)
102 if(empty($yandexLocationsIds))
109 '=XML_ID' => $yandexLocationsIds,
110 '=SERVICE.CODE' => self::EXTERNAL_SERVICE_CODE
114 while($loc =
$res->fetch())
115 $result[$loc[
'XML_ID']] = $loc[
'LOCATION_ID'];
122 if(empty($yandexLocation) || !is_array($yandexLocation))
126 $tmp = $yandexLocation;
127 unset(
$tmp[
'parent']);
130 if(!empty($yandexLocation[
'parent']))
138 if(empty($yandexLocation) || !is_array($yandexLocation))
143 if(empty($locations))
148 if(!empty($mapExternal))
149 foreach($locations as $yLocId => $yLocParams)
150 if(!empty($mapExternal[$yLocId]))
151 return $mapExternal[$yLocId];
153 if(empty($yandexLocation[
"name"]))
extractLocations($yandexLocation)
const EXTERNAL_SERVICE_CODE
getLocationByExternalIds($yandexLocationsIds)
getLocationId($yandexLocation)
getLocationByCityName($cityName)
if(!is_array($prop["VALUES"])) $tmp
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
IncludeModuleLangFile($filepath, $lang=false, $bReturnArray=false)