CCrmRequisiteBankDetailRestProxy::innerUpdate

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. CCrmRequisiteBankDetailRestProxy
  4. innerUpdate
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/classes/general/restservice.php
  • Класс: \CCrmRequisiteBankDetailRestProxy
  • Вызов: CCrmRequisiteBankDetailRestProxy::innerUpdate
protected function innerUpdate($ID, &$fields, &$errors, array $params = null)
{
	$r = $this->getById($ID);
	if(!is_array($r))
	{
		$errors[] = "The RequisiteBankDetail with ID '{$ID}' is not found";
		return false;
	}

	$entityTypeID = intval($r['ENTITY_TYPE_ID']);
	$entityID = intval($r['ENTITY_ID']);

	if(!$this->isValidID($entityTypeID) || !CCrmOwnerType::IsDefined($entityTypeID))
	{
		$errors[] = "ENTITY_TYPE_ID is not defined or invalid.";
		return false;
	}
	if(!$this->checkEntityID($entityID))
	{
		$errors[] = "ENTITY_ID is not defined or invalid.";
		return false;
	}

	if(!EntityBankDetail::checkUpdatePermissionOwnerEntity($entityTypeID, $entityID))
	{
		$errors[] = 'Access denied.';
		return false;
	}

	$entity = self::getEntity();

	$result = $entity->update($ID, $fields, $params);
	if(!$result->isSuccess())
	{
		$errors[] = $result->getErrors();
	}
	elseif(self::isBizProcEnabled())
	{
		CCrmBizProcHelper::AutoStartWorkflows(
				CCrmOwnerType::Company,
				$result->getId(),
				CCrmBizProcEventType::Edit,
				$errors
		);
	}
	return $result->isSuccess();
}

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