vendor/sulu/sulu/src/Sulu/Bundle/TagBundle/Entity/Tag.php line 22

Open in your IDE?
  1. <?php
  2. /*
  3. * This file is part of Sulu.
  4. *
  5. * (c) Sulu GmbH
  6. *
  7. * This source file is subject to the MIT license that is bundled
  8. * with this source code in the file LICENSE.
  9. */
  10. namespace Sulu\Bundle\TagBundle\Entity;
  11. use JMS\Serializer\Annotation\Expose;
  12. use JMS\Serializer\Annotation\Groups;
  13. use Sulu\Bundle\TagBundle\Tag\TagInterface;
  14. use Sulu\Component\Security\Authentication\UserInterface;
  15. /**
  16. * Represents single tag in the system.
  17. */
  18. class Tag implements TagInterface
  19. {
  20. /**
  21. * @var string
  22. */
  23. #[Expose]
  24. #[Groups(['partialTag'])]
  25. private $name;
  26. /**
  27. * @var int
  28. */
  29. #[Groups(['partialTag'])]
  30. private $id;
  31. /**
  32. * @var \DateTime
  33. */
  34. #[Groups(['partialTag'])]
  35. private $created;
  36. /**
  37. * @var \DateTime
  38. */
  39. #[Groups(['partialTag'])]
  40. private $changed;
  41. /**
  42. * @var UserInterface|null
  43. */
  44. private $changer;
  45. /**
  46. * @var UserInterface|null
  47. */
  48. private $creator;
  49. public function setName($name)
  50. {
  51. $this->name = $name;
  52. return $this;
  53. }
  54. public function getName()
  55. {
  56. return $this->name;
  57. }
  58. public function getId()
  59. {
  60. return $this->id;
  61. }
  62. public function setId($id)
  63. {
  64. $this->id = $id;
  65. return $this;
  66. }
  67. public function getCreated()
  68. {
  69. return $this->created;
  70. }
  71. /**
  72. * @return $this
  73. */
  74. public function setCreated(\DateTime $created)
  75. {
  76. $this->created = $created;
  77. return $this;
  78. }
  79. public function getChanged()
  80. {
  81. return $this->changed;
  82. }
  83. /**
  84. * @return $this
  85. */
  86. public function setChanged(\DateTime $changed)
  87. {
  88. $this->changed = $changed;
  89. return $this;
  90. }
  91. /**
  92. * @return $this
  93. */
  94. public function setChanger(?UserInterface $changer = null)
  95. {
  96. $this->changer = $changer;
  97. return $this;
  98. }
  99. public function getChanger()
  100. {
  101. return $this->changer;
  102. }
  103. /**
  104. * @return $this
  105. */
  106. public function setCreator(?UserInterface $creator = null)
  107. {
  108. $this->creator = $creator;
  109. return $this;
  110. }
  111. public function getCreator()
  112. {
  113. return $this->creator;
  114. }
  115. public function __toString()
  116. {
  117. return (string) $this->getName();
  118. }
  119. }