• Модуль: rest
  • Путь к файлу: ~/bitrix/modules/rest/lib/preset/data/element.php
  • Класс: BitrixRestPresetDataElement
  • Вызов: Element::getList
static function getList($sectionCode) : array
{
	$result = [];
	$cache = Cache::createInstance();
	if ($cache->initCache(static::CACHE_TIME, 'section_' . $sectionCode . LANGUAGE_ID, static::CACHE_DIR))
	{
		$result = $cache->getVars();
	}
	elseif ($cache->startDataCache())
	{
		$dictionary = new Integration();

		foreach ($dictionary as $el)
		{
			if (!empty($el['option']))
			{
				$data = Json::decode(base64_decode($el['option']));
				if (is_array($data) && $sectionCode === $data['SECTION_CODE'])
				{
					$data = static::changeMessage($data);
					$data['CODE'] = $data['ELEMENT_CODE'];
					$result[$data['CODE']] = $data;
				}
			}
		}

		if (empty($result))
		{
			foreach (static::DEFAULT_DATA as $data)
			{
				if ($sectionCode === $data['SECTION_CODE'])
				{
					$data = static::changeMessage($data);
					$result[$data['CODE']] = $data;
				}
			}
		}

		$cache->endDataCache($result);
	}

	return $result;
}