CCrmDealRecurringRestProxy::innerGetList

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

	$params = array();
	if(is_array($order) && !empty($order))
	{
		$fieldInfo = $this->getFieldsInfo();
		foreach ($order as $code => $direction)
		{
			if (!empty($fieldInfo[$code]) && $code !== 'PARAMS')
			{
				$params['order'][$code] = $direction;
			}
		}
	}

	unset($filter['PARAMS']);
	$params['filter'] = $filter;

	$page = isset($navigation['iNumPage']) ? (int)$navigation['iNumPage'] : 1;
	$limit = isset($navigation['nPageSize']) ? (int)$navigation['nPageSize'] : CCrmRestService::LIST_LIMIT;

	$restParamsMapper = \Bitrix\Crm\Recurring\Entity\ParameterMapper\RestDeal::getInstance();
	/** @var Main\DB\Result $dataRaw */
	$dataRaw = \Bitrix\Crm\DealRecurTable::getList($params);
	$items = array();
	while($fields = $dataRaw->fetch())
	{
		$params = $fields['PARAMS'];
		$mapper = \Bitrix\Crm\Recurring\Entity\Deal::getParameterMapper($params);
		$mapper->fillMap($params);
		$restParamsMapper->convert($mapper);
		$fields['PARAMS'] = $restParamsMapper->getFormattedMap();
		$items[] = $fields;
	}

	$dbResult = new CDBResult();
	$dbResult->InitFromArray($items);
	$dbResult->NavStart($limit, false, $page);
	return $dbResult;
}

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