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:
parent
22c1d29b89
commit
3c65dfb735
5 changed files with 262 additions and 60 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue