CAllCrmActivity::PrepareCommunications

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. CAllCrmActivity
  4. PrepareCommunications
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/classes/general/crm_activity.php
  • Класс: \CAllCrmActivity
  • Вызов: CAllCrmActivity::PrepareCommunications
static function PrepareCommunications($entityType, $entityID, $communicationType)
{
	$entityType = mb_strtoupper(strval($entityType));
	$entityID = intval($entityID);
	$communicationType = mb_strtoupper($communicationType);
	if($communicationType === '')
	{
		$communicationType = 'PHONE';
	}

	$dbResFields = CCrmFieldMulti::GetList(
		array('ID' => 'asc'),
		array('ENTITY_ID' => $entityType, 'ELEMENT_ID' => $entityID, 'TYPE_ID' =>  $communicationType)
	);

	$result = array();
	while($arField = $dbResFields->Fetch())
	{
		if(empty($arField['VALUE']))
		{
			continue;
		}

		$result[] = array(
			'ENTITY_ID' => $entityID,
			'ENTITY_TYPE' => $entityType,
			'TYPE' => $communicationType,
			'VALUE' => $arField['VALUE'],
			'VALUE_TYPE' => $arField['VALUE_TYPE']
		);
	}

	return $result;
}

Добавить комментарий