EntityBinding::validateEntityTypeId

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. EntityBinding
  4. validateEntityTypeId
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/binding/entitybinding.php
  • Класс: Bitrix\Crm\Binding\EntityBinding
  • Вызов: EntityBinding::validateEntityTypeId
static function validateEntityTypeId(int $entityTypeID): void
{
	if(!\CCrmOwnerType::IsDefined($entityTypeID))
	{
		throw new Main\ArgumentOutOfRangeException('entityTypeID',
			\CCrmOwnerType::FirstOwnerType,
			\CCrmOwnerType::LastOwnerType
		);
	}

	$fieldName = self::resolveEntityFieldName($entityTypeID);
	if (empty($fieldName))
	{
		$entityTypeName = \CCrmOwnerType::ResolveName($entityTypeID);
		throw new Main\NotSupportedException("Entity type: '{$entityTypeName}' is not supported in current context");
	}
}

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