• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/counter/monitor/activitychange.php
  • Класс: Bitrix\Crm\Counter\Monitor\ActivityChange
  • Вызов: ActivityChange::create
static function create(
	int $id,
	array $oldFields,
	array $oldBindings,
	array $newFields,
	array $newBindings,
	?DateTime $oldLightTime,
	?DateTime $newLightTime
): self
{
	$oldDeadline = (isset($oldFields['DEADLINE']) && $oldFields['DEADLINE'] && !\CCrmDateTimeHelper::IsMaxDatabaseDate($oldFields['DEADLINE']))
		? DateTime::createFromUserTime($oldFields['DEADLINE'])
		: null
	;
	$newDeadline = (isset($newFields['DEADLINE']) && $newFields['DEADLINE'] && !\CCrmDateTimeHelper::IsMaxDatabaseDate($newFields['DEADLINE']))
		? DateTime::createFromUserTime($newFields['DEADLINE'])
		: null
	;

	$change = new self(
		$id,
		isset($oldFields['IS_INCOMING_CHANNEL']) ? $oldFields['IS_INCOMING_CHANNEL'] === 'Y' : null,
		isset($newFields['IS_INCOMING_CHANNEL']) ? $newFields['IS_INCOMING_CHANNEL'] === 'Y' : null,
		$oldDeadline,
		$newDeadline,
		isset($oldFields['COMPLETED']) ? $oldFields['COMPLETED'] === 'Y' : null,
		isset($newFields['COMPLETED']) ? $newFields['COMPLETED'] === 'Y' : null,
		isset($oldFields['RESPONSIBLE_ID']) ? (int)$oldFields['RESPONSIBLE_ID'] : null,
		isset($newFields['RESPONSIBLE_ID']) ? (int)$newFields['RESPONSIBLE_ID'] : null,
		self::prepareBindings($oldBindings),
		self::prepareBindings($newBindings),
		$oldLightTime,
		$newLightTime
	);

	return $change;
}