CCrmUserFieldRestProxy::delete

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. CCrmUserFieldRestProxy
  4. delete
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/classes/general/restservice.php
  • Класс: \CCrmUserFieldRestProxy
  • Вызов: CCrmUserFieldRestProxy::delete
public function delete($ID)
{
	if ($ID > 0 && $this->entityID === CCrmInvoice::GetUserFieldEntityID() && parent::checkDeletePermission())
	{
		$invoiceReservedFields = array_fill_keys(CCrmInvoice::GetUserFieldsReserved(), true);

		$entity = new \CUserTypeEntity();
		$result = $entity->GetByID($ID);
		if (is_array($result) && isset($result['FIELD_NAME'])
			&& isset($invoiceReservedFields[$result['FIELD_NAME']]))
		{
			throw new RestException("The entity with ID '{$ID}' is not found.", RestException::ERROR_NOT_FOUND);
		}
	}

	return parent::delete($ID);
}

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