src/Entity/Product.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ProductRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8. * @ORM\Entity(repositoryClass=ProductRepository::class)
  9. */
  10. class Product
  11. {
  12. /**
  13. * @ORM\Id
  14. * @ORM\GeneratedValue
  15. * @ORM\Column(type="integer")
  16. */
  17. private $id;
  18. /**
  19. * @ORM\Column(type="string", length=80)
  20. */
  21. private $tag_id;
  22. /**
  23. * @ORM\ManyToOne(targetEntity=ProductType::class, inversedBy="products")
  24. * @ORM\JoinColumn(nullable=false)
  25. */
  26. private $product_type;
  27. /**
  28. * @ORM\Column(type="date")
  29. */
  30. private $date_entered;
  31. /**
  32. * @ORM\Column(type="date", nullable=True)
  33. */
  34. private $date_sold;
  35. /**
  36. * @ORM\Column(type="string", length=3)
  37. */
  38. private $status;
  39. /**
  40. * @ORM\ManyToOne(targetEntity=Fridge::class, inversedBy="products")
  41. ApiCallLog*/
  42. private $fridge;
  43. /**
  44. * @ORM\ManyToOne(targetEntity=ApiCallLog::class, inversedBy="products")
  45. */
  46. private $api_call_log;
  47. /**
  48. * @ORM\Column(type="date", nullable=true)
  49. */
  50. private $date_expiry;
  51. public function __construct()
  52. {
  53. }
  54. public function __toString()
  55. {
  56. return $this->name;
  57. }
  58. public function getId(): ?int
  59. {
  60. return $this->id;
  61. }
  62. public function getTagId(): ?string
  63. {
  64. return $this->tag_id;
  65. }
  66. public function setTagId(string $tag_id): self
  67. {
  68. $this->tag_id = $tag_id;
  69. return $this;
  70. }
  71. public function getProductType(): ?ProductType
  72. {
  73. return $this->product_type;
  74. }
  75. public function setProductType(?ProductType $product_type): self
  76. {
  77. $this->product_type = $product_type;
  78. return $this;
  79. }
  80. public function getDateEntered(): ?\DateTimeInterface
  81. {
  82. return $this->date_entered;
  83. }
  84. public function setDateEntered(\DateTimeInterface $date_entered): self
  85. {
  86. $this->date_entered = $date_entered;
  87. return $this;
  88. }
  89. public function getDateSold(): ?\DateTimeInterface
  90. {
  91. return $this->date_sold;
  92. }
  93. public function setDateSold(\DateTimeInterface $date_sold): self
  94. {
  95. $this->date_sold = $date_sold;
  96. return $this;
  97. }
  98. public function getStatus(): ?string
  99. {
  100. return $this->status;
  101. }
  102. public function setStatus(string $status): self
  103. {
  104. $this->status = $status;
  105. return $this;
  106. }
  107. public function getFridge(): ?Fridge
  108. {
  109. return $this->fridge;
  110. }
  111. public function setFridge(?Fridge $fridge): self
  112. {
  113. $this->fridge = $fridge;
  114. return $this;
  115. }
  116. public function getApiCallLog(): ?ApiCallLog
  117. {
  118. return $this->api_call_log;
  119. }
  120. public function setApiCallLog(?ApiCallLog $api_call_log): self
  121. {
  122. $this->api_call_log = $api_call_log;
  123. return $this;
  124. }
  125. public function getDateExpiry(): ?\DateTimeInterface
  126. {
  127. return $this->date_expiry;
  128. }
  129. public function setDateExpiry(?\DateTimeInterface $date_expiry): self
  130. {
  131. $this->date_expiry = $date_expiry;
  132. return $this;
  133. }
  134. }