64 if (!isset(self::$entityCache[$entityId.
'Sitemaps']))
66 self::$entityCache[$entityId] = array();
68 $dbRes = self::getList(array(
70 '=ENTITY_TYPE' => static::ENTITY_TYPE,
71 '=ENTITY_ID' => $entityId
75 'SITE_ID' =>
'SITEMAP.SITE_ID',
76 'SITEMAP_SETTINGS' =>
'SITEMAP.SETTINGS'
79 $arSitemaps = array();
80 while($arRes = $dbRes->fetch())
82 $arRes[
"SITEMAP_SETTINGS"] = unserialize($arRes[
'SITEMAP_SETTINGS'], [
'allowed_classes' =>
false]);
83 self::$entityCache[$entityId][] = $arRes;
84 if ($arRes[
"SITEMAP_SETTINGS"][static::ENTITY_TYPE.
"_ACTIVE"] &&
85 $arRes[
"SITEMAP_SETTINGS"][static::ENTITY_TYPE.
"_ACTIVE"][$entityId] ==
"Y")
87 $arSitemaps[] = array(
88 'SITEMAP_ID' => $arRes[
'SITEMAP_ID'],
89 'SITE_ID' => $arRes[
'SITE_ID'],
90 'PROTOCOL' => $arRes[
"SITEMAP_SETTINGS"][
'PROTO'] == 1 ?
'https' :
'http',
91 'DOMAIN' => $arRes[
"SITEMAP_SETTINGS"][
'DOMAIN'],
92 'ROBOTS' => $arRes[
"SITEMAP_SETTINGS"][
'ROBOTS'],
93 'SITEMAP_DIR' => $arRes[
"SITEMAP_SETTINGS"][
'DIR'],
94 'SITEMAP_FILE' => $arRes[
"SITEMAP_SETTINGS"][
'FILENAME_INDEX'],
95 'SITEMAP_FILE_'.static::ENTITY_TYPE => $arRes[
"SITEMAP_SETTINGS"][
'FILENAME_'.static::ENTITY_TYPE],
96 'SITEMAP_SETTINGS' => $arRes[
"SITEMAP_SETTINGS"]
100 self::$entityCache[$entityId.
'Sitemaps'] = $arSitemaps;
103 return self::$entityCache[$entityId.
'Sitemaps'];