src/Entity/Order.php line 12
<?phpnamespace App\Entity;use App\Repository\OrderRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: OrderRepository::class)]#[ORM\Table(name: '`order`')]class Order{#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\ManyToOne(inversedBy: 'orders')]private ?Customer $customer = null;#[ORM\Column]private ?float $total = null;#[ORM\Column]private ?\DateTimeImmutable $createdAt = null;#[ORM\OneToMany(mappedBy: 'orderRef', targetEntity: OrderLine::class,cascade: ['persist','remove'])]private Collection $orderLines;#[ORM\OneToMany(mappedBy: 'orderRef', targetEntity: Payment::class, cascade: ["persist",'remove'])]private Collection $payments;#[ORM\ManyToOne(inversedBy: 'orders')]#[ORM\JoinColumn(nullable: false)]private ?Pos $pos = null;public function __construct(){$this->createdAt = new \DateTimeImmutable();$this->orderLines = new ArrayCollection();$this->payments = new ArrayCollection();}public function getId(): ?int{return $this->id;}public function getCustomer(): ?Customer{return $this->customer;}public function setCustomer(?Customer $customer): self{$this->customer = $customer;return $this;}public function getTotal(): ?float{return $this->total;}public function setTotal(float $total): self{$this->total = $total;return $this;}public function getCreatedAt(): ?\DateTimeImmutable{return $this->createdAt;}public function setCreatedAt(\DateTime $createdAt): self{$this->createdAt = \DateTimeImmutable::createFromMutable($createdAt);return $this;}/*** @return Collection<int, OrderLine>*/public function getOrderLines(): Collection{return $this->orderLines;}public function addOrderLine(OrderLine $orderLine): self{if (!$this->orderLines->contains($orderLine)) {$this->orderLines->add($orderLine);$orderLine->setOrderRef($this);}return $this;}public function removeOrderLine(OrderLine $orderLine): self{if ($this->orderLines->removeElement($orderLine)) {// set the owning side to null (unless already changed)if ($orderLine->getOrderRef() === $this) {$orderLine->setOrderRef(null);}}return $this;}/*** @return Collection<int, Payment>*/public function getPayments(): Collection{return $this->payments;}public function addPayment(Payment $payment): self{if (!$this->payments->contains($payment)) {$this->payments->add($payment);$payment->setOrderRef($this);}return $this;}public function removePayment(Payment $payment): self{if ($this->payments->removeElement($payment)) {// set the owning side to null (unless already changed)if ($payment->getOrderRef() === $this) {$payment->setOrderRef(null);}}return $this;}public function getPos(): ?Pos{return $this->pos;}public function setPos(?Pos $pos): self{$this->pos = $pos;return $this;}}