3 namespace Wallabag\CoreBundle\Entity
;
5 use Doctrine\ORM\Mapping
as ORM
;
6 use JMS\Serializer\Annotation\XmlRoot
;
7 use JMS\Serializer\Annotation\ExclusionPolicy
;
8 use JMS\Serializer\Annotation\Expose
;
9 use Doctrine\Common\Collections\ArrayCollection
;
10 use Gedmo\Mapping\Annotation
as Gedmo
;
16 * @ORM\Table(name="`tag`")
17 * @ORM\Entity(repositoryClass="Wallabag\CoreBundle\Repository\TagRepository")
18 * @ExclusionPolicy("all")
26 * @ORM\Column(name="id", type="integer")
28 * @ORM\GeneratedValue(strategy="AUTO")
36 * @ORM\Column(name="label", type="text")
41 * @Gedmo\Slug(fields={"label"})
42 * @ORM\Column(length=128, unique=true)
47 * @ORM\ManyToMany(targetEntity="Entry", mappedBy="tags", cascade={"persist"})
52 * @ORM\ManyToOne(targetEntity="Wallabag\UserBundle\Entity\User", inversedBy="tags")
56 public function __construct(\Wallabag\UserBundle\Entity\User
$user)
59 $this->entries
= new ArrayCollection();
62 public function __toString()
72 public function getId()
80 * @param string $label
84 public function setLabel($label)
86 $this->label
= $label;
96 public function getLabel()
101 public function getSlug()
106 public function addEntry(Entry
$entry)
108 $this->entries
[] = $entry;
111 public function hasEntry($entry)
113 return $this->entries
->contains($entry);
119 public function getUser()