forked from wallabag/wallabag
add slug for tags
This commit is contained in:
committed by
Jeremy Benoist
parent
22c1d29b89
commit
3c65dfb735
@ -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;
|
||||
|
||||
Reference in New Issue
Block a user