replace fqdn in event bundle

This commit is contained in:
Julien Fastré 2022-04-30 00:42:03 +02:00
parent d0cc0e775f
commit 6da19b0135
7 changed files with 29 additions and 29 deletions

View File

@ -97,7 +97,7 @@ class EventController extends AbstractController
public function deleteAction($event_id, Request $request) public function deleteAction($event_id, Request $request)
{ {
$em = $this->getDoctrine()->getManager(); $em = $this->getDoctrine()->getManager();
$event = $em->getRepository('ChillEventBundle:Event')->findOneBy([ $event = $em->getRepository(\Chill\EventBundle\Entity\Event::class)->findOneBy([
'id' => $event_id, 'id' => $event_id,
]); ]);
@ -151,7 +151,7 @@ class EventController extends AbstractController
{ {
$em = $this->getDoctrine()->getManager(); $em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('ChillEventBundle:Event')->find($event_id); $entity = $em->getRepository(\Chill\EventBundle\Entity\Event::class)->find($event_id);
if (!$entity) { if (!$entity) {
throw $this->createNotFoundException('Unable to find Event entity.'); throw $this->createNotFoundException('Unable to find Event entity.');
@ -192,11 +192,11 @@ class EventController extends AbstractController
$person->getCenter() $person->getCenter()
); );
$total = $em->getRepository('ChillEventBundle:Participation')->countByPerson($person_id); $total = $em->getRepository(\Chill\EventBundle\Entity\Participation::class)->countByPerson($person_id);
$paginator = $this->paginator->create($total); $paginator = $this->paginator->create($total);
$participations = $em->getRepository('ChillEventBundle:Participation')->findByPersonInCircle( $participations = $em->getRepository(\Chill\EventBundle\Entity\Participation::class)->findByPersonInCircle(
$person_id, $person_id,
$reachablesCircles, $reachablesCircles,
$paginator->getCurrentPage()->getFirstItemNumber(), $paginator->getCurrentPage()->getFirstItemNumber(),
@ -352,7 +352,7 @@ class EventController extends AbstractController
{ {
$em = $this->getDoctrine()->getManager(); $em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('ChillEventBundle:Event')->find($event_id); $entity = $em->getRepository(\Chill\EventBundle\Entity\Event::class)->find($event_id);
if (!$entity) { if (!$entity) {
throw $this->createNotFoundException('Unable to find Event entity.'); throw $this->createNotFoundException('Unable to find Event entity.');

View File

@ -60,7 +60,7 @@ class EventTypeController extends AbstractController
if ($form->isValid()) { if ($form->isValid()) {
$em = $this->getDoctrine()->getManager(); $em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('ChillEventBundle:EventType')->find($id); $entity = $em->getRepository(\Chill\EventBundle\Entity\EventType::class)->find($id);
if (!$entity) { if (!$entity) {
throw $this->createNotFoundException('Unable to find EventType entity.'); throw $this->createNotFoundException('Unable to find EventType entity.');
@ -82,7 +82,7 @@ class EventTypeController extends AbstractController
{ {
$em = $this->getDoctrine()->getManager(); $em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('ChillEventBundle:EventType')->find($id); $entity = $em->getRepository(\Chill\EventBundle\Entity\EventType::class)->find($id);
if (!$entity) { if (!$entity) {
throw $this->createNotFoundException('Unable to find EventType entity.'); throw $this->createNotFoundException('Unable to find EventType entity.');
@ -105,7 +105,7 @@ class EventTypeController extends AbstractController
{ {
$em = $this->getDoctrine()->getManager(); $em = $this->getDoctrine()->getManager();
$entities = $em->getRepository('ChillEventBundle:EventType')->findAll(); $entities = $em->getRepository(\Chill\EventBundle\Entity\EventType::class)->findAll();
return $this->render('ChillEventBundle:EventType:index.html.twig', [ return $this->render('ChillEventBundle:EventType:index.html.twig', [
'entities' => $entities, 'entities' => $entities,
@ -135,7 +135,7 @@ class EventTypeController extends AbstractController
{ {
$em = $this->getDoctrine()->getManager(); $em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('ChillEventBundle:EventType')->find($id); $entity = $em->getRepository(\Chill\EventBundle\Entity\EventType::class)->find($id);
if (!$entity) { if (!$entity) {
throw $this->createNotFoundException('Unable to find EventType entity.'); throw $this->createNotFoundException('Unable to find EventType entity.');
@ -158,7 +158,7 @@ class EventTypeController extends AbstractController
{ {
$em = $this->getDoctrine()->getManager(); $em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('ChillEventBundle:EventType')->find($id); $entity = $em->getRepository(\Chill\EventBundle\Entity\EventType::class)->find($id);
if (!$entity) { if (!$entity) {
throw $this->createNotFoundException('Unable to find EventType entity.'); throw $this->createNotFoundException('Unable to find EventType entity.');

View File

@ -258,7 +258,7 @@ class ParticipationController extends AbstractController
public function deleteAction($participation_id, Request $request) public function deleteAction($participation_id, Request $request)
{ {
$em = $this->getDoctrine()->getManager(); $em = $this->getDoctrine()->getManager();
$participation = $em->getRepository('ChillEventBundle:Participation')->findOneBy([ $participation = $em->getRepository(\Chill\EventBundle\Entity\Participation::class)->findOneBy([
'id' => $participation_id, 'id' => $participation_id,
]); ]);
@ -336,7 +336,7 @@ class ParticipationController extends AbstractController
*/ */
public function editMultipleAction($event_id) public function editMultipleAction($event_id)
{ {
$event = $this->getDoctrine()->getRepository('ChillEventBundle:Event') $event = $this->getDoctrine()->getRepository(\Chill\EventBundle\Entity\Event::class)
->find($event_id); ->find($event_id);
if (null === $event) { if (null === $event) {
@ -467,7 +467,7 @@ class ParticipationController extends AbstractController
public function updateMultipleAction($event_id, Request $request) public function updateMultipleAction($event_id, Request $request)
{ {
/** @var \Chill\EventBundle\Entity\Event $event */ /** @var \Chill\EventBundle\Entity\Event $event */
$event = $this->getDoctrine()->getRepository('ChillEventBundle:Event') $event = $this->getDoctrine()->getRepository(\Chill\EventBundle\Entity\Event::class)
->find($event_id); ->find($event_id);
if (null === $event) { if (null === $event) {
@ -569,7 +569,7 @@ class ParticipationController extends AbstractController
// prevent error: `Argument 2 passed to ::getInt() must be of the type int, null given` // prevent error: `Argument 2 passed to ::getInt() must be of the type int, null given`
if (null !== $event_id) { if (null !== $event_id) {
$event = $em->getRepository('ChillEventBundle:Event') $event = $em->getRepository(\Chill\EventBundle\Entity\Event::class)
->find($event_id); ->find($event_id);
if (null === $event) { if (null === $event) {

View File

@ -60,7 +60,7 @@ class RoleController extends AbstractController
if ($form->isValid()) { if ($form->isValid()) {
$em = $this->getDoctrine()->getManager(); $em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('ChillEventBundle:Role')->find($id); $entity = $em->getRepository(\Chill\EventBundle\Entity\Role::class)->find($id);
if (!$entity) { if (!$entity) {
throw $this->createNotFoundException('Unable to find Role entity.'); throw $this->createNotFoundException('Unable to find Role entity.');
@ -82,7 +82,7 @@ class RoleController extends AbstractController
{ {
$em = $this->getDoctrine()->getManager(); $em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('ChillEventBundle:Role')->find($id); $entity = $em->getRepository(\Chill\EventBundle\Entity\Role::class)->find($id);
if (!$entity) { if (!$entity) {
throw $this->createNotFoundException('Unable to find Role entity.'); throw $this->createNotFoundException('Unable to find Role entity.');
@ -105,7 +105,7 @@ class RoleController extends AbstractController
{ {
$em = $this->getDoctrine()->getManager(); $em = $this->getDoctrine()->getManager();
$entities = $em->getRepository('ChillEventBundle:Role')->findAll(); $entities = $em->getRepository(\Chill\EventBundle\Entity\Role::class)->findAll();
return $this->render('ChillEventBundle:Role:index.html.twig', [ return $this->render('ChillEventBundle:Role:index.html.twig', [
'entities' => $entities, 'entities' => $entities,
@ -135,7 +135,7 @@ class RoleController extends AbstractController
{ {
$em = $this->getDoctrine()->getManager(); $em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('ChillEventBundle:Role')->find($id); $entity = $em->getRepository(\Chill\EventBundle\Entity\Role::class)->find($id);
if (!$entity) { if (!$entity) {
throw $this->createNotFoundException('Unable to find Role entity.'); throw $this->createNotFoundException('Unable to find Role entity.');
@ -158,7 +158,7 @@ class RoleController extends AbstractController
{ {
$em = $this->getDoctrine()->getManager(); $em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('ChillEventBundle:Role')->find($id); $entity = $em->getRepository(\Chill\EventBundle\Entity\Role::class)->find($id);
if (!$entity) { if (!$entity) {
throw $this->createNotFoundException('Unable to find Role entity.'); throw $this->createNotFoundException('Unable to find Role entity.');

View File

@ -57,7 +57,7 @@ class StatusController extends AbstractController
if ($form->isValid()) { if ($form->isValid()) {
$em = $this->getDoctrine()->getManager(); $em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('ChillEventBundle:Status')->find($id); $entity = $em->getRepository(\Chill\EventBundle\Entity\Status::class)->find($id);
if (!$entity) { if (!$entity) {
throw $this->createNotFoundException('Unable to find Status entity.'); throw $this->createNotFoundException('Unable to find Status entity.');
@ -79,7 +79,7 @@ class StatusController extends AbstractController
{ {
$em = $this->getDoctrine()->getManager(); $em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('ChillEventBundle:Status')->find($id); $entity = $em->getRepository(\Chill\EventBundle\Entity\Status::class)->find($id);
if (!$entity) { if (!$entity) {
throw $this->createNotFoundException('Unable to find Status entity.'); throw $this->createNotFoundException('Unable to find Status entity.');
@ -102,7 +102,7 @@ class StatusController extends AbstractController
{ {
$em = $this->getDoctrine()->getManager(); $em = $this->getDoctrine()->getManager();
$entities = $em->getRepository('ChillEventBundle:Status')->findAll(); $entities = $em->getRepository(\Chill\EventBundle\Entity\Status::class)->findAll();
return $this->render('ChillEventBundle:Status:index.html.twig', [ return $this->render('ChillEventBundle:Status:index.html.twig', [
'entities' => $entities, 'entities' => $entities,
@ -132,7 +132,7 @@ class StatusController extends AbstractController
{ {
$em = $this->getDoctrine()->getManager(); $em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('ChillEventBundle:Status')->find($id); $entity = $em->getRepository(\Chill\EventBundle\Entity\Status::class)->find($id);
if (!$entity) { if (!$entity) {
throw $this->createNotFoundException('Unable to find Status entity.'); throw $this->createNotFoundException('Unable to find Status entity.');
@ -155,7 +155,7 @@ class StatusController extends AbstractController
{ {
$em = $this->getDoctrine()->getManager(); $em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('ChillEventBundle:Status')->find($id); $entity = $em->getRepository(\Chill\EventBundle\Entity\Status::class)->find($id);
if (!$entity) { if (!$entity) {
throw $this->createNotFoundException('Unable to find Status entity.'); throw $this->createNotFoundException('Unable to find Status entity.');

View File

@ -292,7 +292,7 @@ final class ParticipationControllerTest extends WebTestCase
$this->assertGreaterThan(0, count($span2)); $this->assertGreaterThan(0, count($span2));
// as the container has reloaded, reload the event // as the container has reloaded, reload the event
$event = $this->em->getRepository('ChillEventBundle:Event')->find($event->getId()); $event = $this->em->getRepository(\Chill\EventBundle\Entity\Event::class)->find($event->getId());
$this->em->refresh($event); $this->em->refresh($event);
$this->assertEquals($nbParticipations + 2, $event->getParticipations()->count()); $this->assertEquals($nbParticipations + 2, $event->getParticipations()->count());
@ -388,7 +388,7 @@ final class ParticipationControllerTest extends WebTestCase
$this->assertTrue($this->client->getResponse()->isRedirect()); $this->assertTrue($this->client->getResponse()->isRedirect());
// reload the event and test there is a new participation // reload the event and test there is a new participation
$event = $this->em->getRepository('ChillEventBundle:Event') $event = $this->em->getRepository(\Chill\EventBundle\Entity\Event::class)
->find($event->getId()); ->find($event->getId());
$this->em->refresh($event); $this->em->refresh($event);
@ -439,7 +439,7 @@ final class ParticipationControllerTest extends WebTestCase
$this->assertGreaterThan(0, count($span)); $this->assertGreaterThan(0, count($span));
// as the container has reloaded, reload the event // as the container has reloaded, reload the event
$event = $this->em->getRepository('ChillEventBundle:Event')->find($event->getId()); $event = $this->em->getRepository(\Chill\EventBundle\Entity\Event::class)->find($event->getId());
$this->em->refresh($event); $this->em->refresh($event);
$this->assertEquals($nbParticipations + 1, $event->getParticipations()->count()); $this->assertEquals($nbParticipations + 1, $event->getParticipations()->count());
@ -463,7 +463,7 @@ final class ParticipationControllerTest extends WebTestCase
}); });
$circle = $circles[0]; $circle = $circles[0];
$events = $this->em->getRepository('ChillEventBundle:Event') $events = $this->em->getRepository(\Chill\EventBundle\Entity\Event::class)
->findBy(['center' => $center, 'circle' => $circle]); ->findBy(['center' => $center, 'circle' => $circle]);
return $events[array_rand($events)]; return $events[array_rand($events)];

View File

@ -90,7 +90,7 @@ final class EventSearchTest extends WebTestCase
->findOneBy(['name' => 'Center A']); ->findOneBy(['name' => 'Center A']);
$this->eventType = $this->entityManager $this->eventType = $this->entityManager
->getRepository('ChillEventBundle:EventType') ->getRepository(\Chill\EventBundle\Entity\EventType::class)
->findAll()[0]; ->findAll()[0];
$this->createEvents(); $this->createEvents();