CAllCrmDeal::Rebind

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. CAllCrmDeal
  4. Rebind
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/classes/general/crm_deal.php
  • Класс: \CAllCrmDeal
  • Вызов: CAllCrmDeal::Rebind
static function Rebind($ownerTypeID, $oldID, $newID)
{
	global $DB;

	$ownerTypeID = intval($ownerTypeID);
	$oldID = intval($oldID);
	$newID = intval($newID);
	$tableName = CCrmDeal::TABLE_NAME;

	if($ownerTypeID === CCrmOwnerType::Contact)
	{
		$DB->Query(
			"UPDATE {$tableName} SET CONTACT_ID = {$newID} WHERE CONTACT_ID = {$oldID}",
			false,
			'File: '.__FILE__.'
Line: '.__LINE__ ); } elseif($ownerTypeID === CCrmOwnerType::Company) { $DB->Query( "UPDATE {$tableName} SET COMPANY_ID = {$newID} WHERE COMPANY_ID = {$oldID}", false, 'File: '.__FILE__.'
Line: '.__LINE__ ); } }

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