mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
fix dummy controller
This commit is contained in:
parent
f73d3bf320
commit
bc1f624e14
@ -96,18 +96,21 @@ class AccompanyingCourseController extends Controller
|
||||
$data = [
|
||||
'id' => $accompanyingCourse->getId(),
|
||||
'remark' => $accompanyingCourse->getRemark(),
|
||||
'closing_motive' => $accompanyingCourse->getClosingMotive()->getName()['fr'],
|
||||
'closing_motive' => $accompanyingCourse->getClosingMotive() ? $accompanyingCourse->getClosingMotive()->getName()['fr'] : null,
|
||||
'opening_date' => ($accompanyingCourse->getOpeningDate()) ? $accompanyingCourse->getOpeningDate()->format('Y-m-d') : null,
|
||||
'closing_date' => ($accompanyingCourse->getClosingDate()) ? $accompanyingCourse->getClosingDate()->format('Y-m-d') : null,
|
||||
'persons' => $persons
|
||||
];
|
||||
|
||||
/**
|
||||
$normalizer = [new ObjectNormalizer()];
|
||||
$encoder = [new JsonEncoder()];
|
||||
|
||||
$serializer = new Serializer($normalizer, $encoder);
|
||||
$serialized = $serializer->serialize($data,'json', []);
|
||||
|
||||
*
|
||||
*/
|
||||
$serialized = \json_encode($data);
|
||||
$response = new Response($serialized);
|
||||
$response->headers->set('Content-Type', 'application/json');
|
||||
return $response;
|
||||
|
Loading…
x
Reference in New Issue
Block a user