- Модуль: crm
- Путь к файлу: ~/bitrix/modules/crm/classes/general/restservice.php
- Класс: \CCrmAddressRestProxy
- Вызов: CCrmAddressRestProxy::innerGetList
protected function innerGetList($order, $filter, $select, $navigation, &$errors)
{
if(!EntityAddress::checkReadPermissionOwnerEntity())
{
$errors[] = 'Access denied.';
return false;
}
$entity = self::getEntity();
$page = isset($navigation['iNumPage']) ? (int)$navigation['iNumPage'] : 1;
$limit = isset($navigation['nPageSize']) ? (int)$navigation['nPageSize'] : CCrmRestService::LIST_LIMIT;
$offset = $limit * $page;
if(!is_array($select))
$select = array();
if(empty($select))
$select = array_keys($this->getFieldsInfo());
//For backward compatibility only
if(isset($filter['ENTITY_TYPE_ID']) &&
($filter['ENTITY_TYPE_ID'] == CCrmOwnerType::Company || $filter['ENTITY_TYPE_ID'] == CCrmOwnerType::Contact))
{
$filter['ANCHOR_TYPE_ID'] = $filter['ENTITY_TYPE_ID'];
unset($filter['ENTITY_TYPE_ID']);
if(isset($filter['ENTITY_ID']))
{
$filter['ANCHOR_ID'] = $filter['ENTITY_ID'];
unset($filter['ENTITY_ID']);
}
}
$result = $entity->getList(
array(
'order' => $order,
'filter' => $filter,
'select' => $select,
'offset' => $offset,
'count_total' => true
)
);
if (is_object($result))
{
$dbResult = new CDBResult($result);
}
else
{
$dbResult = new CDBResult();
$dbResult->InitFromArray(array());
}
$dbResult->NavStart($limit, false, $page);
return $dbResult;
}