CCrmUserFieldRestProxy::update

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. CCrmUserFieldRestProxy
  4. update
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/classes/general/restservice.php
  • Класс: \CCrmUserFieldRestProxy
  • Вызов: CCrmUserFieldRestProxy::update
public function update($ID, array $fields)
{
	if ($ID > 0 && $this->entityID === CCrmInvoice::GetUserFieldEntityID() && parent::checkUpdatePermission())
	{
		$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::update($ID, $fields);
}

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