protected function createAdvancedPaginationBar($startRowNumber)
    {
        # Add prev link.
        if( $this->isAdvancedPrevLink($startRowNumber) )
        {
            $this->addPrevLink($startRowNumber, $prevLink);
        }
        # Remove prev link.
        else
        {
            $this->removeLinkFromPagingationBar($prevLink);
        }

        # Add first, next, last links.
        if( $this->isAdvancedNextLink($startRowNumber) )
        {
            $this->addNextLink($startRowNumber, $nextLink);
            $this->addLastLink($lastLink);
            
            $pageIndex = $this->getPageIndex($startRowNumber);
        }
        # Remove next, last links.
        else
        {
            $this->removeLinkFromPagingationBar($nextLink);
            $this->removeLinkFromPagingationBar($lastLink);

            $pageIndex = $this->getPageIndexWithoutNextLinks();
        }
        
        # On the first page, remove the first link.
        if( $this->isFirstLink($startRowNumber, $pageIndex) )
        {
            $this->removeLinkFromPagingationBar($firstLink);
        }
        else
        {
            $this->addFirstLink($firstLink);
        }

        $advancedPerPage = $this->getAdvancedPerPage($pageIndex, $nextLink, $lastLink);
        
        return $this->generatePaginationBar($firstLink, $prevLink, $this->getNumberLinks($advancedPerPage, $startRowNumber, $pageIndex), $nextLink, $lastLink);
    }