1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-07-17 17:08:37 +00:00

add slug for tags

This commit is contained in:
Nicolas Lœuillet 2015-10-14 21:30:25 +02:00 committed by Jeremy Benoist
parent 22c1d29b89
commit 3c65dfb735
5 changed files with 262 additions and 60 deletions

View file

@ -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;