From 3c65dfb735c7ccdee3d8ea420fe295439d53bb13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Wed, 14 Oct 2015 21:30:25 +0200 Subject: add slug for tags --- src/Wallabag/CoreBundle/Entity/Tag.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src') 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; use JMS\Serializer\Annotation\ExclusionPolicy; use JMS\Serializer\Annotation\Expose; use Doctrine\Common\Collections\ArrayCollection; +use Gedmo\Mapping\Annotation as Gedmo; /** * Tag. @@ -36,6 +37,12 @@ class Tag */ private $label; + /** + * @Gedmo\Slug(fields={"label"}) + * @ORM\Column(length=128, unique=true) + */ + private $slug; + /** * @ORM\ManyToMany(targetEntity="Entry", mappedBy="tags", cascade={"persist"}) */ @@ -91,6 +98,11 @@ class Tag return $this->label; } + public function getSlug() + { + return $this->slug; + } + public function addEntry(Entry $entry) { $this->entries[] = $entry; -- cgit v1.2.3