add option to select previous menuitems
All checks were successful
/ ls (pull_request) Successful in 33s
/ ls (push) Successful in 29s

This commit is contained in:
lubiana 2024-06-26 20:12:27 +02:00
parent 57b4e33028
commit 45029e0a4c
No known key found for this signature in database
11 changed files with 410 additions and 94 deletions

55
src/Entity/MenuItem.php Normal file
View file

@ -0,0 +1,55 @@
<?php declare(strict_types=1);
namespace App\Entity;
use App\Repository\MenuItemRepository;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\IdGenerator\UlidGenerator;
use Symfony\Bridge\Doctrine\Types\UlidType;
use Symfony\Component\Uid\Ulid;
#[ORM\Entity(repositoryClass: MenuItemRepository::class)]
class MenuItem
{
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'CUSTOM')]
#[ORM\Column(type: UlidType::NAME, unique: true)]
#[ORM\CustomIdGenerator(class: UlidGenerator::class)]
private Ulid|null $id = null;
#[ORM\Column(length: 255)]
private string|null $name = null;
#[ORM\ManyToOne(inversedBy: 'menuItems')]
#[ORM\JoinColumn(nullable: false)]
private FoodVendor|null $foodVendor = null;
public function getId(): Ulid|null
{
return $this->id;
}
public function getName(): string|null
{
return $this->name;
}
public function setName(string $name): static
{
$this->name = $name;
return $this;
}
public function getFoodVendor(): FoodVendor|null
{
return $this->foodVendor;
}
public function setFoodVendor(FoodVendor|null $foodVendor): static
{
$this->foodVendor = $foodVendor;
return $this;
}
}