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

  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.      */
  26.     private $name;
  27.     /**
  28.      * @var int
  29.      *
  30.      * @Groups({"partialTag"})
  31.      */
  32.     private $id;
  33.     /**
  34.      * @var \DateTime
  35.      *
  36.      * @Groups({"partialTag"})
  37.      */
  38.     private $created;
  39.     /**
  40.      * @var \DateTime
  41.      *
  42.      * @Groups({"partialTag"})
  43.      */
  44.     private $changed;
  45.     /**
  46.      * @var UserInterface|null
  47.      */
  48.     private $changer;
  49.     /**
  50.      * @var UserInterface|null
  51.      */
  52.     private $creator;
  53.     public function setName($name)
  54.     {
  55.         $this->name $name;
  56.         return $this;
  57.     }
  58.     public function getName()
  59.     {
  60.         return $this->name;
  61.     }
  62.     public function getId()
  63.     {
  64.         return $this->id;
  65.     }
  66.     public function setId($id)
  67.     {
  68.         $this->id $id;
  69.         return $this;
  70.     }
  71.     public function getCreated()
  72.     {
  73.         return $this->created;
  74.     }
  75.     /**
  76.      * @return $this
  77.      */
  78.     public function setCreated(\DateTime $created)
  79.     {
  80.         $this->created $created;
  81.         return $this;
  82.     }
  83.     public function getChanged()
  84.     {
  85.         return $this->changed;
  86.     }
  87.     /**
  88.      * @return $this
  89.      */
  90.     public function setChanged(\DateTime $changed)
  91.     {
  92.         $this->changed $changed;
  93.         return $this;
  94.     }
  95.     /**
  96.      * @return $this
  97.      */
  98.     public function setChanger(UserInterface $changer null)
  99.     {
  100.         $this->changer $changer;
  101.         return $this;
  102.     }
  103.     public function getChanger()
  104.     {
  105.         return $this->changer;
  106.     }
  107.     /**
  108.      * @return $this
  109.      */
  110.     public function setCreator(UserInterface $creator null)
  111.     {
  112.         $this->creator $creator;
  113.         return $this;
  114.     }
  115.     public function getCreator()
  116.     {
  117.         return $this->creator;
  118.     }
  119.     public function __toString()
  120.     {
  121.         return $this->getName();
  122.     }
  123. }