src/Entity/ListItems.php line 9

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ListItemsRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. #[ORM\Entity(repositoryClass: ListItemsRepository::class)]
  6. class ListItems
  7. {
  8. #[ORM\Id]
  9. #[ORM\GeneratedValue]
  10. #[ORM\Column(type: 'integer')]
  11. private $id;
  12. #[ORM\ManyToOne(targetEntity: Products::class, inversedBy: 'listItems')]
  13. private $product;
  14. #[ORM\ManyToOne(targetEntity: Distributors::class, inversedBy: 'listItems')]
  15. private $distributor;
  16. #[ORM\Column(type: 'string', length: 255)]
  17. private $name;
  18. #[ORM\Column(type: 'datetime')]
  19. private $modified;
  20. #[ORM\Column(type: 'datetime')]
  21. private $created;
  22. #[ORM\ManyToOne(targetEntity: Lists::class, inversedBy: 'listItems')]
  23. private $list;
  24. #[ORM\ManyToOne(targetEntity: DistributorProducts::class, inversedBy: 'listItems')]
  25. private $distributorProduct;
  26. #[ORM\Column(type: 'integer')]
  27. private $qty;
  28. #[ORM\Column(type: 'string', length: 255, nullable: true)]
  29. private $itemId;
  30. #[ORM\Column(type: 'float', nullable: true)]
  31. private $unitPrice;
  32. public function __construct()
  33. {
  34. $date = new \DateTime("now", new \DateTimeZone('Asia/Dubai'));
  35. $this->setModified($date);
  36. if ($this->getCreated() == null)
  37. {
  38. $this->setCreated($date);
  39. }
  40. }
  41. public function getId(): ?int
  42. {
  43. return $this->id;
  44. }
  45. public function getProduct(): ?Products
  46. {
  47. return $this->product;
  48. }
  49. public function setProduct(?Products $product): self
  50. {
  51. $this->product = $product;
  52. return $this;
  53. }
  54. public function getDistributor(): ?Distributors
  55. {
  56. return $this->distributor;
  57. }
  58. public function setDistributor(?Distributors $distributor): self
  59. {
  60. $this->distributor = $distributor;
  61. return $this;
  62. }
  63. public function getName(): ?string
  64. {
  65. return $this->name;
  66. }
  67. public function setName(string $name): self
  68. {
  69. $this->name = $name;
  70. return $this;
  71. }
  72. public function getModified(): ?\DateTimeInterface
  73. {
  74. return $this->modified;
  75. }
  76. public function setModified(\DateTimeInterface $modified): self
  77. {
  78. $this->modified = $modified;
  79. return $this;
  80. }
  81. public function getCreated(): ?\DateTimeInterface
  82. {
  83. return $this->created;
  84. }
  85. public function setCreated(\DateTimeInterface $created): self
  86. {
  87. $this->created = $created;
  88. return $this;
  89. }
  90. public function getList(): ?Lists
  91. {
  92. return $this->list;
  93. }
  94. public function setList(?Lists $list): self
  95. {
  96. $this->list = $list;
  97. return $this;
  98. }
  99. public function getDistributorProduct(): ?DistributorProducts
  100. {
  101. return $this->distributorProduct;
  102. }
  103. public function setDistributorProduct(?DistributorProducts $distributorProduct): self
  104. {
  105. $this->distributorProduct = $distributorProduct;
  106. return $this;
  107. }
  108. public function getQty(): ?int
  109. {
  110. return $this->qty;
  111. }
  112. public function setQty(int $qty): self
  113. {
  114. $this->qty = $qty;
  115. return $this;
  116. }
  117. public function getItemId(): ?string
  118. {
  119. return $this->itemId;
  120. }
  121. public function setItemId(?string $itemId): self
  122. {
  123. $this->itemId = $itemId;
  124. return $this;
  125. }
  126. public function getUnitPrice(): ?float
  127. {
  128. return $this->unitPrice;
  129. }
  130. public function setUnitPrice(?float $unitPrice): self
  131. {
  132. $this->unitPrice = $unitPrice;
  133. return $this;
  134. }
  135. }