mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
inject PaginatorFactory in constructor
This commit is contained in:
parent
46293a9baf
commit
0affc534c5
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user