fixie
This commit is contained in:
parent
300c8cafc9
commit
6bb49e8f79
6 changed files with 26 additions and 33 deletions
|
@ -9,6 +9,7 @@ use Doctrine\Common\Collections\Collection;
|
|||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Bridge\Doctrine\IdGenerator\UlidGenerator;
|
||||
use Symfony\Bridge\Doctrine\Types\UlidType;
|
||||
use Symfony\Component\Serializer\Annotation\Groups;
|
||||
use Symfony\Component\Uid\Ulid;
|
||||
|
||||
#[ORM\Entity(repositoryClass: FoodVendorRepository::class)]
|
||||
|
@ -16,11 +17,13 @@ use Symfony\Component\Uid\Ulid;
|
|||
class FoodVendor
|
||||
{
|
||||
#[ORM\Column(length: 50)]
|
||||
#[Groups(['food_order:latest'])]
|
||||
private string|null $name = null;
|
||||
|
||||
#[ORM\Column(length: 50, nullable: true, options: [
|
||||
'default' => '',
|
||||
])]
|
||||
#[Groups(['food_order:latest'])]
|
||||
private string|null $phone = null;
|
||||
|
||||
/**
|
||||
|
@ -36,6 +39,7 @@ class FoodVendor
|
|||
private Collection $menuItems;
|
||||
|
||||
#[ORM\Column(length: 255, nullable: true)]
|
||||
#[Groups(['food_order:latest'])]
|
||||
private string|null $menuLink = null;
|
||||
|
||||
public function __construct(
|
||||
|
@ -43,6 +47,7 @@ class FoodVendor
|
|||
#[ORM\GeneratedValue(strategy: 'CUSTOM')]
|
||||
#[ORM\Column(type: UlidType::NAME, unique: true)]
|
||||
#[ORM\CustomIdGenerator(class: UlidGenerator::class)]
|
||||
#[Groups(['food_order:latest'])]
|
||||
private Ulid|null $id = new Ulid
|
||||
) {
|
||||
$this->id ??= new Ulid;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue