• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/tracking/internals/traceentity.php
  • Класс: Bitrix\Crm\Tracking\Internals\TraceEntityTable
  • Вызов: TraceEntityTable::rebind
static function rebind($oldEntityTypeID, $oldEntityID, $newEntityTypeID, $newEntityID)
{
	if($oldEntityTypeID <= 0)
	{
		throw new Main\ArgumentException('Must be greater than zero.', 'oldEntityTypeID');
	}

	if($oldEntityID <= 0)
	{
		throw new Main\ArgumentException('Must be greater than zero.', 'oldEntityID');
	}

	if($newEntityTypeID <= 0)
	{
		throw new Main\ArgumentException('Must be greater than zero.', 'newEntityTypeID');
	}

	if($newEntityID <= 0)
	{
		throw new Main\ArgumentException('Must be greater than zero.', 'newEntityID');
	}

	Main\Application::getConnection()->queryExecute(
		"UPDATE b_crm_tracking_trace_entity SET ENTITY_TYPE_ID = {$newEntityTypeID}, ENTITY_ID = {$newEntityID} WHERE ENTITY_TYPE_ID = {$oldEntityTypeID} AND ENTITY_ID = {$oldEntityID}"
	);
}