aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle
diff options
context:
space:
mode:
authorJeremy Benoist <j0k3r@users.noreply.github.com>2015-12-28 13:12:30 +0100
committerJeremy Benoist <j0k3r@users.noreply.github.com>2015-12-28 13:12:30 +0100
commit82899c040258896bff540080602e93aa49a71ae8 (patch)
tree4687785a472b4f5001dc73374247eeca2206da6a /src/Wallabag/CoreBundle
parent22c1d29b898f0e33c23a571a8fa6820f76145b69 (diff)
parent3c65dfb735c7ccdee3d8ea420fe295439d53bb13 (diff)
downloadwallabag-82899c040258896bff540080602e93aa49a71ae8.tar.gz
wallabag-82899c040258896bff540080602e93aa49a71ae8.tar.zst
wallabag-82899c040258896bff540080602e93aa49a71ae8.zip
Merge pull request #1488 from wallabag/v2-slug-tags
Slug for tags
Diffstat (limited to 'src/Wallabag/CoreBundle')
-rw-r--r--src/Wallabag/CoreBundle/Entity/Tag.php12
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;
7use JMS\Serializer\Annotation\ExclusionPolicy; 7use JMS\Serializer\Annotation\ExclusionPolicy;
8use JMS\Serializer\Annotation\Expose; 8use JMS\Serializer\Annotation\Expose;
9use Doctrine\Common\Collections\ArrayCollection; 9use Doctrine\Common\Collections\ArrayCollection;
10use 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;