From db67ed3194583438cfbe18803e62553f787d13a9 Mon Sep 17 00:00:00 2001 From: nobohan Date: Wed, 20 Oct 2021 22:04:20 +0200 Subject: [PATCH] rdv->calendar: add location --- .../ChillActivityBundle/Controller/ActivityController.php | 5 +++++ .../ChillCalendarBundle/Controller/CalendarController.php | 1 + 2 files changed, 6 insertions(+) diff --git a/src/Bundle/ChillActivityBundle/Controller/ActivityController.php b/src/Bundle/ChillActivityBundle/Controller/ActivityController.php index 8a4a228eb..9529d40c0 100644 --- a/src/Bundle/ChillActivityBundle/Controller/ActivityController.php +++ b/src/Bundle/ChillActivityBundle/Controller/ActivityController.php @@ -242,6 +242,11 @@ class ActivityController extends AbstractController } } + if (array_key_exists('location', $activityData)) { + $location = $em->getRepository(\Chill\MainBundle\Entity\Location::class)->find($activityData['location']); + $entity->setLocation($location); + } + if (array_key_exists('comment', $activityData)) { $comment = new CommentEmbeddable(); $comment->setComment($activityData['comment']); diff --git a/src/Bundle/ChillCalendarBundle/Controller/CalendarController.php b/src/Bundle/ChillCalendarBundle/Controller/CalendarController.php index 71e461464..a62963e07 100644 --- a/src/Bundle/ChillCalendarBundle/Controller/CalendarController.php +++ b/src/Bundle/ChillCalendarBundle/Controller/CalendarController.php @@ -234,6 +234,7 @@ class CalendarController extends AbstractController 'professionalsId' => $professionalsId, 'date' => $entity->getStartDate()->format('Y-m-d'), 'durationTime' => $durationTimeInMinutes, + 'location' => $entity->getLocation()->getId(), 'comment' => $entity->getComment()->getComment(), ];