!20 add createdby field to order form

This commit is contained in:
lubiana 2024-06-30 09:56:35 +02:00
parent 511f12f10f
commit 70041d7357
No known key found for this signature in database
4 changed files with 7 additions and 0 deletions

View file

@ -26,6 +26,8 @@ final class FoodOrderController extends AbstractController
public function new(Request $request, EntityManagerInterface $entityManager): Response
{
$foodOrder = new FoodOrder;
$username = $request->cookies->get('username', 'nobody');
$foodOrder->setCreatedBy($username);
$form = $this->createForm(FoodOrderType::class, $foodOrder, [
'action' => $this->generateUrl('app_food_order_new'),
]);