CCrmLiveFeedComponent::mergeCommunications

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. CCrmLiveFeedComponent
  4. mergeCommunications
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/classes/general/livefeed.php
  • Класс: \CCrmLiveFeedComponent
  • Вызов: CCrmLiveFeedComponent::mergeCommunications
static function mergeCommunications($commList1, $commList2)
{
	if (!is_array($commList2))
	{
		$commList2 = array();
	}
	$result = $commList2;

	foreach($commList1 as $comm1)
	{
		$found = false;
		foreach($result as $comm2)
		{
			if (
				$comm1['TYPE'] == $comm2['TYPE']
				&& $comm1['VALUE'] == $comm2['VALUE']
				&& $comm1['ENTITY_TYPE_ID'] == $comm2['ENTITY_TYPE_ID']
				&& $comm1['ENTITY_ID'] == $comm2['ENTITY_ID']
			)
			{
				$found = true;
				break;
			}
		}

		if (!$found)
		{
			$result[] = $comm1;
		}
	}

	return $result;
}

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