diff options
author | Nicolas LÅ“uillet <nicolas.loeuillet@smile.fr> | 2015-10-14 21:30:25 +0200 |
---|---|---|
committer | Jeremy Benoist <jeremy.benoist@gmail.com> | 2015-12-28 12:49:45 +0100 |
commit | 3c65dfb735c7ccdee3d8ea420fe295439d53bb13 (patch) | |
tree | 4687785a472b4f5001dc73374247eeca2206da6a /src | |
parent | 22c1d29b898f0e33c23a571a8fa6820f76145b69 (diff) | |
download | wallabag-3c65dfb735c7ccdee3d8ea420fe295439d53bb13.tar.gz wallabag-3c65dfb735c7ccdee3d8ea420fe295439d53bb13.tar.zst wallabag-3c65dfb735c7ccdee3d8ea420fe295439d53bb13.zip |
add slug for tags
Diffstat (limited to 'src')
-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; |