CCrmQuoteRestProxy::innerGet

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. CCrmQuoteRestProxy
  4. innerGet
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/classes/general/restservice.php
  • Класс: \CCrmQuoteRestProxy
  • Вызов: CCrmQuoteRestProxy::innerGet
protected function innerGet($ID, &$errors)
{
	if(!CCrmQuote::CheckReadPermission($ID))
	{
		$errors[] = 'Access denied.';
		return false;
	}

	$dbRes = CCrmQuote::GetList(
		array(),
		array('=ID' => $ID),
		false,
		false,
		array(),
		array()
	);

	$result = $dbRes ? $dbRes->Fetch() : null;
	if(!is_array($result))
	{
		$errors[] = 'Not found';
		return false;
	}

	$result = \Bitrix\Crm\Entity\CommentsHelper::prepareFieldsFromCompatibleRestToRead(
		$this->getOwnerTypeID(),
		$ID,
		$result,
	);

	$userFields = $GLOBALS['USER_FIELD_MANAGER']->GetUserFields(CCrmQuote::$sUFEntityID, $ID, LANGUAGE_ID);
	foreach($userFields as $ufName => &$ufData)
	{
		$result[$ufName] = $ufData['VALUE'] ?? '';
	}
	unset($ufData);

	return $result;
}

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