• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/pseudoactivity/waitentry.php
  • Класс: Bitrix\Crm\Pseudoactivity\WaitEntry
  • Вызов: WaitEntry::transferOwnership
static function transferOwnership($oldOwnerTypeID, $oldOwnerID, $newOwnerTypeID, $newOwnerID)
{
	if(!\CCrmOwnerType::IsDefined($oldOwnerTypeID))
	{
		throw new Main\ArgumentOutOfRangeException('oldOwnerTypeID',
			\CCrmOwnerType::FirstOwnerType,
			\CCrmOwnerType::LastOwnerType
		);
	}

	if(!is_int($oldOwnerID))
	{
		$oldOwnerID = (int)$oldOwnerID;
	}

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

	if($newOwnerTypeID <= 0)
	{
		throw new Main\ArgumentOutOfRangeException('newOwnerTypeID',
			\CCrmOwnerType::FirstOwnerType,
			\CCrmOwnerType::LastOwnerType
		);
	}

	if(!is_int($newOwnerID))
	{
		$newOwnerID = (int)$newOwnerID;
	}

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

	WaitTable::transferOwnership($oldOwnerTypeID, $oldOwnerID, $newOwnerTypeID, $newOwnerID);
}