diff options
Diffstat (limited to 'src/Wallabag')
-rw-r--r-- | src/Wallabag/CoreBundle/Entity/Tag.php | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Entity/Tag.php b/src/Wallabag/CoreBundle/Entity/Tag.php index 7cc452fd..4ed588be 100644 --- a/src/Wallabag/CoreBundle/Entity/Tag.php +++ b/src/Wallabag/CoreBundle/Entity/Tag.php | |||
@@ -7,6 +7,7 @@ use JMS\Serializer\Annotation\XmlRoot; | |||
7 | use JMS\Serializer\Annotation\ExclusionPolicy; | 7 | use JMS\Serializer\Annotation\ExclusionPolicy; |
8 | use JMS\Serializer\Annotation\Expose; | 8 | use JMS\Serializer\Annotation\Expose; |
9 | use Doctrine\Common\Collections\ArrayCollection; | 9 | use Doctrine\Common\Collections\ArrayCollection; |
10 | use Gedmo\Mapping\Annotation as Gedmo; | ||
10 | 11 | ||
11 | /** | 12 | /** |
12 | * Tag. | 13 | * Tag. |
@@ -37,6 +38,12 @@ class Tag | |||
37 | private $label; | 38 | private $label; |
38 | 39 | ||
39 | /** | 40 | /** |
41 | * @Gedmo\Slug(fields={"label"}) | ||
42 | * @ORM\Column(length=128, unique=true) | ||
43 | */ | ||
44 | private $slug; | ||
45 | |||
46 | /** | ||
40 | * @ORM\ManyToMany(targetEntity="Entry", mappedBy="tags", cascade={"persist"}) | 47 | * @ORM\ManyToMany(targetEntity="Entry", mappedBy="tags", cascade={"persist"}) |
41 | */ | 48 | */ |
42 | private $entries; | 49 | private $entries; |
@@ -91,6 +98,11 @@ class Tag | |||
91 | return $this->label; | 98 | return $this->label; |
92 | } | 99 | } |
93 | 100 | ||
101 | public function getSlug() | ||
102 | { | ||
103 | return $this->slug; | ||
104 | } | ||
105 | |||
94 | public function addEntry(Entry $entry) | 106 | public function addEntry(Entry $entry) |
95 | { | 107 | { |
96 | $this->entries[] = $entry; | 108 | $this->entries[] = $entry; |