Ejemplo n.º 1
0
        $sortBy = 'ORGANIZATION';
    } else {
        $sortTypeID = Integrity\DuplicateIndexType::PERSON;
        $sortBy = 'PERSON';
    }
}
$arResult['SORT_TYPE_ID'] = $sortTypeID;
$arResult['SORT_BY'] = $sortBy;
$sortOrder = $arResult['SORT_ORDER'] = isset($_GET['sortOrder']) && strtoupper($_GET['sortOrder']) === 'DESC' ? SORT_DESC : SORT_ASC;
if (empty($selectedTypes)) {
    $arResult['ITEMS'] = array();
    $arResult['ENTITY_INFOS'] = array();
    $arResult['HAS_PREV_PAGE'] = false;
    $arResult['HAS_NEXT_PAGE'] = false;
} else {
    $list = new Integrity\DuplicateList(Integrity\DuplicateIndexType::joinType(array_keys($selectedTypes)), $entityTypeID, $userID, $enablePermissionCheck);
    $list->setSortTypeID($sortTypeID);
    $list->setSortOrder($sortOrder);
    $items = $list->getRootItems(($pageNum - 1) * $itemsPerPage, $itemsPerPage + 1);
    if (count($items) <= $itemsPerPage) {
        $arResult['HAS_NEXT_PAGE'] = false;
    } else {
        $arResult['HAS_NEXT_PAGE'] = true;
        array_pop($items);
    }
    $arResult['HAS_PREV_PAGE'] = $pageNum > 1;
    $arResult['ITEMS'] = $items;
    $entityInfos = array();
    /** @var Integrity\Duplicate $item **/
    foreach ($items as $item) {
        $entityID = $item->getRootEntityID();