protected function getAdvancedPerPage($pageIndex, &$nextLink, &$lastLink)
    {
        $perPage = $this->countLinks + $pageIndex - 1;

        if( $perPage >= ($getPerPage = $this->getPerPage()) )
        {
            $this->removeLinkFromPagingationBar($nextLink);
            $this->removeLinkFromPagingationBar($lastLink);

            $perPage = $getPerPage;
        }

        return $perPage;
    }