mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-04 22:04:59 +00:00
fix error with getInt() and inject PaginatorFactory service in EventController
This commit is contained in:
@@ -24,6 +24,7 @@ namespace Chill\EventBundle\Controller;
|
||||
|
||||
use Chill\EventBundle\Entity\Participation;
|
||||
use Chill\EventBundle\Form\Type\PickEventType;
|
||||
use Chill\MainBundle\Pagination\PaginatorFactory;
|
||||
use PhpOffice\PhpSpreadsheet\Spreadsheet;
|
||||
use PhpOffice\PhpSpreadsheet\Writer\Csv;
|
||||
use PhpOffice\PhpSpreadsheet\Writer\Ods;
|
||||
@@ -77,6 +78,11 @@ class EventController extends Controller
|
||||
*/
|
||||
protected $translator;
|
||||
|
||||
/**
|
||||
* @var PaginatorFactory
|
||||
*/
|
||||
protected $paginator;
|
||||
|
||||
/**
|
||||
* EventController constructor.
|
||||
*
|
||||
@@ -84,18 +90,21 @@ class EventController extends Controller
|
||||
* @param AuthorizationHelper $authorizationHelper
|
||||
* @param FormFactoryInterface $formFactoryInterface
|
||||
* @param TranslatorInterface $translator
|
||||
* @param PaginatorFactory $paginator
|
||||
*/
|
||||
public function __construct(
|
||||
EventDispatcherInterface $eventDispatcher,
|
||||
AuthorizationHelper $authorizationHelper,
|
||||
FormFactoryInterface $formFactoryInterface,
|
||||
TranslatorInterface $translator
|
||||
TranslatorInterface $translator,
|
||||
PaginatorFactory $paginator
|
||||
)
|
||||
{
|
||||
$this->eventDispatcher = $eventDispatcher;
|
||||
$this->authorizationHelper = $authorizationHelper;
|
||||
$this->formFactoryInterface = $formFactoryInterface;
|
||||
$this->translator = $translator;
|
||||
$this->paginator = $paginator;
|
||||
}
|
||||
|
||||
|
||||
@@ -388,11 +397,7 @@ class EventController extends Controller
|
||||
|
||||
$total = $em->getRepository('ChillEventBundle:Participation')->countByPerson($person_id);
|
||||
|
||||
/**
|
||||
* @var $paginatorFactory \Chill\MainBundle\Pagination\PaginatorFactory
|
||||
*/
|
||||
$paginatorFactory = $this->get('chill_main.paginator_factory');
|
||||
$paginator = $paginatorFactory->create($total);
|
||||
$paginator = $this->paginator->create($total);
|
||||
|
||||
$participations = $em->getRepository('ChillEventBundle:Participation')->findByPersonInCircle(
|
||||
$person_id,
|
||||
|
Reference in New Issue
Block a user