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 = [
|
$data = [
|
||||||
'id' => $accompanyingCourse->getId(),
|
'id' => $accompanyingCourse->getId(),
|
||||||
'remark' => $accompanyingCourse->getRemark(),
|
'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,
|
'opening_date' => ($accompanyingCourse->getOpeningDate()) ? $accompanyingCourse->getOpeningDate()->format('Y-m-d') : null,
|
||||||
'closing_date' => ($accompanyingCourse->getClosingDate()) ? $accompanyingCourse->getClosingDate()->format('Y-m-d') : null,
|
'closing_date' => ($accompanyingCourse->getClosingDate()) ? $accompanyingCourse->getClosingDate()->format('Y-m-d') : null,
|
||||||
'persons' => $persons
|
'persons' => $persons
|
||||||
];
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
$normalizer = [new ObjectNormalizer()];
|
$normalizer = [new ObjectNormalizer()];
|
||||||
$encoder = [new JsonEncoder()];
|
$encoder = [new JsonEncoder()];
|
||||||
|
|
||||||
$serializer = new Serializer($normalizer, $encoder);
|
$serializer = new Serializer($normalizer, $encoder);
|
||||||
$serialized = $serializer->serialize($data,'json', []);
|
$serialized = $serializer->serialize($data,'json', []);
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
$serialized = \json_encode($data);
|
||||||
$response = new Response($serialized);
|
$response = new Response($serialized);
|
||||||
$response->headers->set('Content-Type', 'application/json');
|
$response->headers->set('Content-Type', 'application/json');
|
||||||
return $response;
|
return $response;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user