protected function createPager(AdapterInterface $adapter, $currentPage, $maxPerPage, Tag $tag = null)
    {
        if ($adapter instanceof TagAdapterInterface && $tag instanceof Tag) {
            $adapter->setTag($tag);
        }

        $pager = new Pagerfanta($adapter);

        $pager->setNormalizeOutOfRangePages(true);
        $pager->setMaxPerPage($maxPerPage);
        $pager->setCurrentPage($currentPage > 0 ? $currentPage : 1);

        return $pager;
    }
protected function createPager(AdapterInterface $adapter, $currentPage, $maxPerPage, Tag $tag = null)
    {
        if ($adapter instanceof TagAdapterInterface && $tag instanceof Tag) {
            $adapter->setTag($tag);
        }

        $pager = new Pagerfanta($adapter);

        $pager->setNormalizeOutOfRangePages(true);
        $pager->setMaxPerPage($maxPerPage);
        $pager->setCurrentPage($currentPage > 0 ? $currentPage : 1);

        return $pager;
    }
protected function createPager ( AdapterInterface $ adapter , $ currentPage , $ maxPerPage , Tag $ tag = null ) { if ( $ adapter instanceof TagAdapterInterface && $ tag instanceof Tag ) { $ adapter -> setTag ( $ tag ) ; } $ pager = new Pagerfanta ( $ adapter ) ; $ pager -> setNormalizeOutOfRangePages ( true ) ; $ pager -> setMaxPerPage ( $ maxPerPage ) ; $ pager -> setCurrentPage ( $ currentPage > 0 ? $ currentPage : 1 ) ; return $ pager ; }
Creates a pager for use with various pages.

@param \Pagerfanta\Adapter\AdapterInterface $adapter
@param int $currentPage
@param int $maxPerPage
@param \Netgen\TagsBundle\API\Repository\Values\Tags\Tag $tag

@return \Pagerfanta\Pagerfanta
Creates a pager for use with various pages .