fixie
All checks were successful
/ ls (pull_request) Successful in 1m33s
/ ls (push) Successful in 1m28s
/ ls (release) Successful in 1m0s

This commit is contained in:
lubiana 2025-06-18 16:56:49 +02:00
parent 300c8cafc9
commit 6bb49e8f79
Signed by: lubiana
SSH key fingerprint: SHA256:vW1EA0fRR3Fw+dD/sM0K+x3Il2gSry6YRYHqOeQwrfk
6 changed files with 26 additions and 33 deletions

View file

@ -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;