86 if(!isset(self::$entityCache[$entityId.
'Sitemaps']))
88 self::$entityCache[$entityId] = array();
90 $dbRes = self::getList(array(
92 'ENTITY_TYPE' => static::ENTITY_TYPE,
93 'ENTITY_ID' => $entityId
97 'SITE_ID' =>
'SITEMAP.SITE_ID',
98 'SITEMAP_SETTINGS' =>
'SITEMAP.SETTINGS'
101 $arSitemaps = array();
102 while($arRes = $dbRes->fetch())
104 $arRes[
"SITEMAP_SETTINGS"] = unserialize($arRes[
'SITEMAP_SETTINGS'], [
'allowed_classes' =>
false]);
105 self::$entityCache[$entityId][] = $arRes;
106 if ($arRes[
"SITEMAP_SETTINGS"][static::ENTITY_TYPE.
"_ACTIVE"] &&
107 $arRes[
"SITEMAP_SETTINGS"][static::ENTITY_TYPE.
"_ACTIVE"][$entityId] ==
"Y")
109 $arSitemaps[] = array(
110 'SITEMAP_ID' => $arRes[
'SITEMAP_ID'],
111 'SITE_ID' => $arRes[
'SITE_ID'],
112 'PROTOCOL' => $arRes[
"SITEMAP_SETTINGS"][
'PROTO'] == 1 ?
'https' :
'http',
113 'DOMAIN' => $arRes[
"SITEMAP_SETTINGS"][
'DOMAIN'],
114 'ROBOTS' => $arRes[
"SITEMAP_SETTINGS"][
'ROBOTS'],
115 'SITEMAP_DIR' => $arRes[
"SITEMAP_SETTINGS"][
'DIR'],
116 'SITEMAP_FILE' => $arRes[
"SITEMAP_SETTINGS"][
'FILENAME_INDEX'],
117 'SITEMAP_FILE_'.static::ENTITY_TYPE => $arRes[
"SITEMAP_SETTINGS"][
'FILENAME_'.static::ENTITY_TYPE],
118 'SITEMAP_SETTINGS' => $arRes[
"SITEMAP_SETTINGS"]
122 self::$entityCache[$entityId.
'Sitemaps'] = $arSitemaps;
125 return self::$entityCache[$entityId.
'Sitemaps'];