CommunicationStatistics::updateActivity

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. CommunicationStatistics
  4. updateActivity
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/activity/communicationstatistics.php
  • Класс: Bitrix\Crm\Activity\CommunicationStatistics
  • Вызов: CommunicationStatistics::updateActivity
static function updateActivity(array $activity, array $prevFields)
{
	$bindings = static::getCommunicationBindings($activity);
	$prevBindings = static::getCommunicationBindings($prevFields);

	$curNeedle = static::isRegistrationNeedle($activity);
	$prevNeedle = static::isRegistrationNeedle($prevFields);

	if (!$curNeedle && !$prevNeedle && !$bindings && !$prevBindings)
		return true;

	if ($prevNeedle)
	{
		if ($curNeedle)
			$prevBindings = static::getLostBindings($prevBindings, $bindings);
		if ($prevBindings)
		{
			static::updateStatistics($prevFields, $prevBindings);
		}
	}

	if ($curNeedle && $bindings)
		static::updateStatistics($activity, $bindings);
}

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