100% test coverage
All checks were successful
/ ls (pull_request) Successful in 37s
/ ls (push) Successful in 37s
/ ls (release) Successful in 24s

This commit is contained in:
lubiana 2024-08-16 13:44:16 +02:00
parent 2a28465626
commit 34171d6c2b
No known key found for this signature in database
8 changed files with 214 additions and 16 deletions

View file

@ -13,12 +13,6 @@ use Symfony\Component\Uid\Ulid;
#[ORM\Entity(repositoryClass: FoodVendorRepository::class)]
class FoodVendor
{
#[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: 50)]
private string|null $name = null;
@ -34,8 +28,13 @@ class FoodVendor
#[ORM\OneToMany(targetEntity: MenuItem::class, mappedBy: 'foodVendor', orphanRemoval: true)]
private Collection $menuItems;
public function __construct()
{
public function __construct(
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'CUSTOM')]
#[ORM\Column(type: UlidType::NAME, unique: true)]
#[ORM\CustomIdGenerator(class: UlidGenerator::class)]
private Ulid|null $id = new Ulid
) {
$this->foodOrders = new ArrayCollection;
$this->menuItems = new ArrayCollection;
}