forked from lubiana/futtern
86 lines
1.9 KiB
PHP
86 lines
1.9 KiB
PHP
<?php declare(strict_types=1);
|
|
|
|
namespace App\Entity;
|
|
|
|
use App\Repository\OrderItemRepository;
|
|
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: OrderItemRepository::class)]
|
|
class OrderItem
|
|
{
|
|
#[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\Column(length: 255, nullable: true)]
|
|
private string|null $extras = null;
|
|
|
|
#[ORM\ManyToOne(inversedBy: 'orderItems')]
|
|
#[ORM\JoinColumn(nullable: true)]
|
|
private FoodOrder|null $foodOrder = null;
|
|
|
|
#[ORM\ManyToOne]
|
|
#[ORM\JoinColumn(nullable: false)]
|
|
private MenuItem|null $menuItem = 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 getExtras(): string|null
|
|
{
|
|
return $this->extras;
|
|
}
|
|
|
|
public function setExtras(string|null $extras): static
|
|
{
|
|
$this->extras = $extras;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getFoodOrder(): FoodOrder|null
|
|
{
|
|
return $this->foodOrder;
|
|
}
|
|
|
|
public function setFoodOrder(FoodOrder|null $foodOrder): static
|
|
{
|
|
$this->foodOrder = $foodOrder;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getMenuItem(): MenuItem|null
|
|
{
|
|
return $this->menuItem;
|
|
}
|
|
|
|
public function setMenuItem(MenuItem|null $menuItem): static
|
|
{
|
|
$this->menuItem = $menuItem;
|
|
|
|
return $this;
|
|
}
|
|
}
|