add orm and tests

This commit is contained in:
lubiana 2024-06-10 20:22:44 +02:00
parent a32bf4ce7d
commit a541338909
No known key found for this signature in database
23 changed files with 1666 additions and 23 deletions

39
src/Entity/FoodVendor.php Normal file
View file

@ -0,0 +1,39 @@
<?php
namespace App\Entity;
use App\Repository\FoodVendorRepository;
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: 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 $name = null;
public function getId(): ?Ulid
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): static
{
$this->name = $name;
return $this;
}
}