CCrmEntityBindingProxy::setOwnerEntityTypeID

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. CCrmEntityBindingProxy
  4. setOwnerEntityTypeID
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/classes/general/restservice.php
  • Класс: \CCrmEntityBindingProxy
  • Вызов: CCrmEntityBindingProxy::setOwnerEntityTypeID
public function setOwnerEntityTypeID($entityTypeID)
{
	if(is_int($entityTypeID))
	{
		$entityTypeID = (int)$entityTypeID;
	}

	if(!CCrmOwnerType::IsDefined($entityTypeID))
	{
		throw new RestException("Parameter 'entityTypeID' is not defined");
	}

	if(
		$entityTypeID !== CCrmOwnerType::Deal
		&& $entityTypeID !== CCrmOwnerType::Lead
		&& $entityTypeID !== CCrmOwnerType::Quote
		&& $entityTypeID !== CCrmOwnerType::Contact
		&& $entityTypeID !== CCrmOwnerType::Company
	)
	{
		$entityTypeName = CCrmOwnerType::ResolveName($entityTypeID);

		throw new RestException("The owner entity type '{$entityTypeName}' is not supported in current context.");
	}

	$this->ownerEntityTypeID = $entityTypeID;
}

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