• Модуль: landing
  • Путь к файлу: ~/bitrix/modules/landing/lib/connector/crm.php
  • Класс: BitrixLandingConnectorCrm
  • Вызов: Crm::getCompanyCommunications
static function getCompanyCommunications(int $companyId): array
{
	if (!Loader::includeModule('crm'))
	{
		return [];
	}

	$data = [];

	$res = CCrmFieldMulti::getList(
		['ID' => 'asc'],
		[
			'ENTITY_ID' => CCrmOwnerType::CompanyName,
			'ELEMENT_ID' => $companyId,
		]
	);
	while ($row = $res->Fetch())
	{
		$row = array_change_key_case($row);
		$row['type_id'] = mb_strtolower($row['type_id']);

		if (!isset($data[$row['type_id']]))
		{
			$data[$row['type_id']] = [];
		}
		$data[$row['type_id']][] = $row['value'];
	}

	return $data;
}