diff --git a/Controller/ReportController.php b/Controller/ReportController.php index b1075a146..2c9a7f4bd 100644 --- a/Controller/ReportController.php +++ b/Controller/ReportController.php @@ -21,6 +21,7 @@ namespace Chill\ReportBundle\Controller; +use Chill\MainBundle\Pagination\PaginatorFactory; use Chill\MainBundle\Security\Authorization\AuthorizationHelper; use Chill\PersonBundle\Privacy\PrivacyEvent; use Symfony\Component\EventDispatcher\EventDispatcherInterface; @@ -51,16 +52,27 @@ class ReportController extends Controller */ protected $authorizationHelper; + /** + * @var PaginatorFactory + */ + protected $paginator; + /** * ReportController constructor. * * @param EventDispatcherInterface $eventDispatcher * @param AuthorizationHelper $authorizationHelper + * @param PaginatorFactory $paginator */ - public function __construct(EventDispatcherInterface $eventDispatcher, AuthorizationHelper $authorizationHelper) + public function __construct( + EventDispatcherInterface $eventDispatcher, + AuthorizationHelper $authorizationHelper, + PaginatorFactory $paginator + ) { $this->eventDispatcher = $eventDispatcher; $this->authorizationHelper = $authorizationHelper; + $this->paginator = $paginator; } @@ -91,7 +103,7 @@ class ReportController extends Controller ->getSingleScalarResult(); // get the PaginatorFactory - $paginator = $this->get('chill_main.paginator_factory')->create($total); + $paginator = $this->paginator->create($total); $reports = $em->createQuery('SELECT r FROM ChillReportBundle:Report r