src/Entity/Order.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\OrderRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8. * @ORM\Entity(repositoryClass=OrderRepository::class)
  9. * @ORM\Table(name="`order`")
  10. */
  11. class Order
  12. {
  13. /**
  14. * @ORM\Id
  15. * @ORM\GeneratedValue
  16. * @ORM\Column(type="integer")
  17. */
  18. private $id;
  19. /**
  20. * @ORM\OneToMany(targetEntity=OrderLine::class, mappedBy="xorder")
  21. */
  22. private $orderLines;
  23. /**
  24. * @ORM\Column(type="date")
  25. */
  26. private $SupplyDate;
  27. public function __construct()
  28. {
  29. $this->orderLines = new ArrayCollection();
  30. }
  31. public function getId(): ?int
  32. {
  33. return $this->id;
  34. }
  35. /**
  36. * @return Collection<int, OrderLine>
  37. */
  38. public function getOrderLines(): Collection
  39. {
  40. return $this->orderLines;
  41. }
  42. public function addOrderLine(OrderLine $orderLine): self
  43. {
  44. if (!$this->orderLines->contains($orderLine)) {
  45. $this->orderLines[] = $orderLine;
  46. $orderLine->setXorder($this);
  47. }
  48. return $this;
  49. }
  50. public function removeOrderLine(OrderLine $orderLine): self
  51. {
  52. if ($this->orderLines->removeElement($orderLine)) {
  53. // set the owning side to null (unless already changed)
  54. if ($orderLine->getXorder() === $this) {
  55. $orderLine->setXorder(null);
  56. }
  57. }
  58. return $this;
  59. }
  60. public function getSupplyDate(): ?\DateTimeInterface
  61. {
  62. return $this->SupplyDate;
  63. }
  64. public function setSupplyDate(\DateTimeInterface $SupplyDate): self
  65. {
  66. $this->SupplyDate = $SupplyDate;
  67. return $this;
  68. }
  69. }