src/Entity/System/TagRelation.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Entity\System;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5. * @ORM\Table(name="ps_tag_relation", indexes={
  6. *
  7. * @ORM\Index(name="ps_tag_relation_id_product_id_tag_index", columns={"id_product", "id_tag"}),
  8. * @ORM\Index(name="FK_ps_tag_relation_ps_tag", columns={"id_tag"}),
  9. * @ORM\Index(name="active", columns={"active"})
  10. * })
  11. *
  12. * @ORM\Entity(repositoryClass="App\Repository\System\TagRelationRepository")
  13. */
  14. class TagRelation
  15. {
  16. /**
  17. * @var int
  18. *
  19. * @ORM\Column(name="id_tag_relation", type="integer")
  20. *
  21. * @ORM\GeneratedValue(strategy="AUTO")
  22. *
  23. * @ORM\Id
  24. */
  25. private $id;
  26. /**
  27. * @var int
  28. *
  29. * @ORM\Column(name="id_tag", type="integer")
  30. */
  31. private int $tagId;
  32. /**
  33. * @var \DateTime
  34. *
  35. * @ORM\Column(name="created_at", type="datetime", options={"default":"CURRENT_TIMESTAMP"})
  36. */
  37. private $dateAdd;
  38. /**
  39. * @var bool
  40. *
  41. * @ORM\Column(name="active", type="boolean")
  42. */
  43. private $active;
  44. /**
  45. * @ORM\ManyToOne(targetEntity="Product")
  46. *
  47. * @ORM\JoinColumn(name="id_product", referencedColumnName="id_product", nullable=true)
  48. */
  49. private Product $product;
  50. public function getId(): int
  51. {
  52. return $this->id;
  53. }
  54. public function getTagId(): int
  55. {
  56. return $this->tagId;
  57. }
  58. public function setTagId(int $tagId): TagRelation
  59. {
  60. $this->tagId = $tagId;
  61. return $this;
  62. }
  63. public function isActive(): bool
  64. {
  65. return $this->active;
  66. }
  67. public function setActive(bool $active): TagRelation
  68. {
  69. $this->active = $active;
  70. return $this;
  71. }
  72. public function getDateAdd(): \DateTime
  73. {
  74. return $this->dateAdd;
  75. }
  76. public function setDateAdd(\DateTime $dateAdd): TagRelation
  77. {
  78. $this->dateAdd = $dateAdd;
  79. return $this;
  80. }
  81. public function getProduct(): Product
  82. {
  83. return $this->product;
  84. }
  85. public function setProduct(Product $product): TagRelation
  86. {
  87. $this->product = $product;
  88. return $this;
  89. }
  90. }