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
;
16 * @ORM\Entity(repositoryClass="Wallabag\CoreBundle\Repository\TagRepository")
17 * @ExclusionPolicy("all")
25 * @ORM\Column(name="id", type="integer")
27 * @ORM\GeneratedValue(strategy="AUTO")
35 * @ORM\Column(name="label", type="text")
40 * @ORM\ManyToMany(targetEntity="Entry", mappedBy="tags", cascade={"persist"})
45 * @ORM\ManyToOne(targetEntity="User", inversedBy="tags")
49 public function __construct(User
$user)
52 $this->entries
= new ArrayCollection();
55 public function __toString()
65 public function getId()
73 * @param string $label
77 public function setLabel($label)
79 $this->label
= $label;
89 public function getLabel()
94 public function addEntry(Entry
$entry)
96 $this->entries
[] = $entry;
99 public function hasEntry($entry)
101 return $this->entries
->contains($entry);
107 public function getUser()