public function injectPager(FilterViewParametersEvent $event)
    {
        $view = $event->getView();
        if (!$view instanceof TagView) {
            return;
        }

        if ($this->adapter instanceof TagAdapterInterface) {
            $this->adapter->setTag($view->getTag());
        }

        $pager = new Pagerfanta($this->adapter);

        $pager->setNormalizeOutOfRangePages(true);

        $builderParameters = $event->getBuilderParameters();

        $pager->setMaxPerPage($this->pagerLimit > 0 ? $this->pagerLimit : 10);
        $pager->setCurrentPage($builderParameters['page'] > 0 ? $builderParameters['page'] : 1);

        $event->getParameterBag()->set('related_content', $pager);
    }
public function injectPager(FilterViewParametersEvent $event)
    {
        $view = $event->getView();
        if (!$view instanceof TagView) {
            return;
        }

        if ($this->adapter instanceof TagAdapterInterface) {
            $this->adapter->setTag($view->getTag());
        }

        $pager = new Pagerfanta($this->adapter);

        $pager->setNormalizeOutOfRangePages(true);

        $builderParameters = $event->getBuilderParameters();

        $pager->setMaxPerPage($this->pagerLimit > 0 ? $this->pagerLimit : 10);
        $pager->setCurrentPage($builderParameters['page'] > 0 ? $builderParameters['page'] : 1);

        $event->getParameterBag()->set('related_content', $pager);
    }
public function injectPager ( FilterViewParametersEvent $ event ) { $ view = $ event -> getView ( ) ; if ( ! $ view instanceof TagView ) { return ; } if ( $ this -> adapter instanceof TagAdapterInterface ) { $ this -> adapter -> setTag ( $ view -> getTag ( ) ) ; } $ pager = new Pagerfanta ( $ this -> adapter ) ; $ pager -> setNormalizeOutOfRangePages ( true ) ; $ builderParameters = $ event -> getBuilderParameters ( ) ; $ pager -> setMaxPerPage ( $ this -> pagerLimit > 0 ? $ this -> pagerLimit : 10 ) ; $ pager -> setCurrentPage ( $ builderParameters [ 'page' ] > 0 ? $ builderParameters [ 'page' ] : 1 ) ; $ event -> getParameterBag ( ) -> set ( 'related_content' , $ pager ) ; }
Injects the pager with related content into the view.

@param \eZ\Publish\Core\MVC\Symfony\View\Event\FilterViewParametersEvent $event
Injects the pager with related content into the view .