!20 add username to order and item

This commit is contained in:
lubiana 2024-06-27 23:33:32 +02:00
parent 9d81464fd8
commit 511f12f10f
No known key found for this signature in database
12 changed files with 147 additions and 24 deletions

View file

@ -34,6 +34,11 @@ class FoodOrder
#[ORM\OneToMany(targetEntity: OrderItem::class, mappedBy: 'foodOrder', orphanRemoval: true)]
private Collection $orderItems;
#[ORM\Column(length: 255, options: [
'default' => 'nobody',
])]
private string|null $createdBy = 'nobody';
public function __construct()
{
$this->orderItems = new ArrayCollection;
@ -117,4 +122,16 @@ class FoodOrder
return $this;
}
public function getCreatedBy(): string|null
{
return $this->createdBy;
}
public function setCreatedBy(string $createdBy): static
{
$this->createdBy = $createdBy;
return $this;
}
}