forked from lubiana/futtern
add order
This commit is contained in:
parent
7663f684a4
commit
1dc5306967
37 changed files with 1060 additions and 113 deletions
70
src/Entity/OrderItem.php
Normal file
70
src/Entity/OrderItem.php
Normal file
|
@ -0,0 +1,70 @@
|
|||
<?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: false)]
|
||||
private FoodOrder|null $foodOrder = 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;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue