src/Entity/System/Tag.php line 20

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Entity\System;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7. * @ORM\Table(name="tag", indexes={
  8. *
  9. * @ORM\Index(name="active", columns={"active"}),
  10. * @ORM\Index(name="ps_tag_deleted_active_index", columns={"deleted", "active"}),
  11. * @ORM\Index(name="deleted", columns={"deleted"}),
  12. * })
  13. *
  14. * @ORM\Entity(repositoryClass="App\Repository\System\TagRepository")
  15. */
  16. class Tag
  17. {
  18. public const BLACK_FRIDAY_TAG_ID = 72;
  19. public const HOTDEAL_TAG_ID = 85;
  20. /**
  21. * @var int
  22. *
  23. * @ORM\Column(name="id", type="integer")
  24. *
  25. * @ORM\Id
  26. */
  27. private $id;
  28. /**
  29. * @var TagLanguage[]|ArrayCollection<int, TagLanguage>
  30. *
  31. * @ORM\OneToMany(targetEntity="App\Entity\System\TagLanguage", mappedBy="tag", cascade={"persist"})
  32. */
  33. private $tagLanguages;
  34. /**
  35. * @var bool
  36. *
  37. * @ORM\Column(name="active", type="boolean")
  38. */
  39. private $active;
  40. /**
  41. * @var bool
  42. *
  43. * @ORM\Column(name="deleted", type="boolean", options={"default" : 0})
  44. */
  45. private $deleted;
  46. public function getId(): int
  47. {
  48. return $this->id;
  49. }
  50. public function setId(int $id): Tag
  51. {
  52. $this->id = $id;
  53. return $this;
  54. }
  55. /**
  56. * @return TagLanguage[]|ArrayCollection<int, TagLanguage>
  57. */
  58. public function getTagLanguages()
  59. {
  60. return $this->tagLanguages;
  61. }
  62. public function addTagLanguage(TagLanguage $tagLanguage): Tag
  63. {
  64. $this->tagLanguages[] = $tagLanguage;
  65. $tagLanguage->setTag($this);
  66. return $this;
  67. }
  68. /**
  69. * @param TagLanguage[]|ArrayCollection<int, TagLanguage> $tagLanguages
  70. */
  71. public function setTagLanguages($tagLanguages): Tag
  72. {
  73. $this->tagLanguages = $tagLanguages;
  74. return $this;
  75. }
  76. public function isActive(): bool
  77. {
  78. return $this->active;
  79. }
  80. public function setActive(bool $active): Tag
  81. {
  82. $this->active = $active;
  83. return $this;
  84. }
  85. public function isDeleted(): bool
  86. {
  87. return $this->deleted;
  88. }
  89. public function setDeleted(bool $deleted): Tag
  90. {
  91. $this->deleted = $deleted;
  92. return $this;
  93. }
  94. }