Classes/Controller/ManagementController.php
protected function preparePagination(Demand $demand, int $count): array
    {
        $numberOfPages = ceil($count / $demand->getLimit());
        $endRecord = $demand->getOffset() + $demand->getLimit();
        if ($endRecord > $count) {
            $endRecord = $count;
        }

        $pagination = [
            'current' => $demand->getPage(),
            'numberOfPages' => $numberOfPages,
            'hasLessPages' => $demand->getPage() > 1,
            'hasMorePages' => $demand->getPage() < $numberOfPages,
            'startRecord' => $demand->getOffset() + 1,
            'endRecord' => $endRecord
        ];
        if ($pagination['current'] < $pagination['numberOfPages']) {
            $pagination['nextPage'] = $pagination['current'] + 1;
        }
        if ($pagination['current'] > 1) {
            $pagination['previousPage'] = $pagination['current'] - 1;
        }
        return $pagination;
    }
protected function preparePagination(Demand $demand, int $count): array
    {
        $numberOfPages = ceil($count / $demand->getLimit());
        $endRecord = $demand->getOffset() + $demand->getLimit();
        if ($endRecord > $count) {
            $endRecord = $count;
        }

        $pagination = [
            'current' => $demand->getPage(),
            'numberOfPages' => $numberOfPages,
            'hasLessPages' => $demand->getPage() > 1,
            'hasMorePages' => $demand->getPage() < $numberOfPages,
            'startRecord' => $demand->getOffset() + 1,
            'endRecord' => $endRecord
        ];
        if ($pagination['current'] < $pagination['numberOfPages']) {
            $pagination['nextPage'] = $pagination['current'] + 1;
        }
        if ($pagination['current'] > 1) {
            $pagination['previousPage'] = $pagination['current'] - 1;
        }
        return $pagination;
    }
protected function preparePagination ( Demand $ demand , int $ count ) : array { $ numberOfPages = ceil ( $ count / $ demand -> getLimit ( ) ) ; $ endRecord = $ demand -> getOffset ( ) + $ demand -> getLimit ( ) ; if ( $ endRecord > $ count ) { $ endRecord = $ count ; } $ pagination = [ 'current' => $ demand -> getPage ( ) , 'numberOfPages' => $ numberOfPages , 'hasLessPages' => $ demand -> getPage ( ) > 1 , 'hasMorePages' => $ demand -> getPage ( ) < $ numberOfPages , 'startRecord' => $ demand -> getOffset ( ) + 1 , 'endRecord' => $ endRecord ] ; if ( $ pagination [ 'current' ] < $ pagination [ 'numberOfPages' ] ) { $ pagination [ 'nextPage' ] = $ pagination [ 'current' ] + 1 ; } if ( $ pagination [ 'current' ] > 1 ) { $ pagination [ 'previousPage' ] = $ pagination [ 'current' ] - 1 ; } return $ pagination ; }
Prepares information for the pagination of the module

@param Demand $demand
@param int $count
@return array
Prepares information for the pagination of the module