- Модуль: sale
- Путь к файлу: ~/bitrix/modules/sale/lib/discount/prediction/manager.php
- Класс: BitrixSaleDiscountPredictionManager
- Вызов: Manager::getSectionData
private function getSectionData($sectionId, array $templates = []): ?array
{
if (is_array($sectionId))
{
$sectionId = array_pop($sectionId);
}
$sectionId = (int)$sectionId;
if ($sectionId <= 0)
{
return null;
}
$iterator = CIBlockSection::GetList(
[],
['=ID' => $sectionId, 'CHECK_PERMISSIONS' => 'N'],
false,
false,
['ID', 'IBLOCK_ID', 'NAME', 'SECTION_PAGE_URL', 'CODE', 'IBLOCK_SECTION_ID']
);
if (!empty($templates['SECTION_URL']))
{
$iterator->SetUrlTemplates('', $templates['SECTION_URL']);
}
$row = $iterator->GetNext();
unset($iterator);
if (empty($row))
{
return null;
}
return [
'#NAME#' => $row['~NAME'],
'#LINK#' => $row['~SECTION_PAGE_URL']
];
}