#64: wip add phonenumberfield to foodvendor
This commit is contained in:
parent
2d3100b5c9
commit
b65a4814f4
6 changed files with 75 additions and 3 deletions
|
@ -23,8 +23,10 @@ final class FoodVendorController extends AbstractController
|
|||
}
|
||||
|
||||
#[Route('/new', name: 'app_food_vendor_new', methods: ['GET', 'POST'])]
|
||||
public function new(Request $request, EntityManagerInterface $entityManager): Response
|
||||
{
|
||||
public function new(
|
||||
Request $request,
|
||||
EntityManagerInterface $entityManager
|
||||
): Response {
|
||||
$foodVendor = new FoodVendor;
|
||||
$form = $this->createForm(FoodVendorType::class, $foodVendor);
|
||||
$form->handleRequest($request);
|
||||
|
@ -63,7 +65,6 @@ final class FoodVendorController extends AbstractController
|
|||
}
|
||||
|
||||
return $this->render('food_vendor/edit.html.twig', [
|
||||
'food_vendor' => $foodVendor,
|
||||
'form' => $form,
|
||||
]);
|
||||
}
|
||||
|
|
|
@ -16,6 +16,11 @@ class FoodVendor
|
|||
#[ORM\Column(length: 50)]
|
||||
private string|null $name = null;
|
||||
|
||||
#[ORM\Column(length: 50, nullable: true, options: [
|
||||
'default' => "",
|
||||
])]
|
||||
private string|null $phone = null;
|
||||
|
||||
/**
|
||||
* @var Collection<int, FoodOrder>
|
||||
*/
|
||||
|
@ -131,4 +136,15 @@ class FoodVendor
|
|||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getPhone(): string|null
|
||||
{
|
||||
return $this->phone;
|
||||
}
|
||||
|
||||
public function setPhone(string|null $phone): static
|
||||
{
|
||||
$this->phone = $phone;
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,6 +16,7 @@ final class FoodVendorType extends AbstractType
|
|||
$builder
|
||||
->add('name')
|
||||
->add('menuLink')
|
||||
->add('phone')
|
||||
;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue