• Модуль: rest
  • Путь к файлу: ~/bitrix/modules/rest/lib/preset/data/section.php
  • Класс: BitrixRestPresetDataSection
  • Вызов: Section::get
static function get() : array
{
	$result = [];
	$cache = Cache::createInstance();
	if ($cache->initCache(static::CACHE_TIME, 'sectionsIndexPage' . LANGUAGE_ID, static::CACHE_DIR))
	{
		$result = $cache->getVars();
	}
	elseif ($cache->startDataCache())
	{
		$dictionary = new IntegrationSection();
		foreach ($dictionary as $el)
		{
			if (!empty($el['option']))
			{
				$data = Json::decode(base64_decode($el['option']));
				if (is_array($data))
				{
					$data = static::changeMessage($data);
					$data['CODE'] = $data['SECTION_CODE'];
					$result[$data['CODE']] = $data;
				}
			}
		}

		if (empty($result))
		{
			$result = static::changeMessage(static::DEFAULT_DATA);
		}

		$cache->endDataCache($result);
	}

	return $result;
}