<?php
namespace 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(type="integer")
*/
private $id;
/**
* @ORM\OneToMany(targetEntity=OrderLine::class, mappedBy="xorder")
*/
private $orderLines;
/**
* @ORM\Column(type="date")
*/
private $SupplyDate;
public function __construct()
{
$this->orderLines = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
/**
* @return Collection<int, OrderLine>
*/
public function getOrderLines(): Collection
{
return $this->orderLines;
}
public function addOrderLine(OrderLine $orderLine): self
{
if (!$this->orderLines->contains($orderLine)) {
$this->orderLines[] = $orderLine;
$orderLine->setXorder($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->getXorder() === $this) {
$orderLine->setXorder(null);
}
}
return $this;
}
public function getSupplyDate(): ?\DateTimeInterface
{
return $this->SupplyDate;
}
public function setSupplyDate(\DateTimeInterface $SupplyDate): self
{
$this->SupplyDate = $SupplyDate;
return $this;
}
}