|
@@ -4,6 +4,7 @@ namespace Muzich\CoreBundle\Entity;
|
4
|
4
|
|
5
|
5
|
use Doctrine\ORM\Mapping as ORM;
|
6
|
6
|
use \Doctrine\Common\Collections\ArrayCollection;
|
|
7
|
+use Gedmo\Mapping\Annotation as Gedmo;
|
7
|
8
|
|
8
|
9
|
/**
|
9
|
10
|
* Cet entité représente le Tag.
|
|
@@ -11,6 +12,7 @@ use \Doctrine\Common\Collections\ArrayCollection;
|
11
|
12
|
* @ORM\Entity
|
12
|
13
|
* @ORM\Table(name="tag")
|
13
|
14
|
* @ORM\Entity(repositoryClass="Muzich\CoreBundle\Repository\TagRepository")
|
|
15
|
+ * @ORM\HasLifecycleCallbacks()
|
14
|
16
|
*/
|
15
|
17
|
class Tag
|
16
|
18
|
{
|
|
@@ -55,6 +57,12 @@ class Tag
|
55
|
57
|
protected $name;
|
56
|
58
|
|
57
|
59
|
/**
|
|
60
|
+ * @Gedmo\Slug(fields={"name"})
|
|
61
|
+ * @ORM\Column(length=64, nullable=true)
|
|
62
|
+ */
|
|
63
|
+ protected $slug;
|
|
64
|
+
|
|
65
|
+ /**
|
58
|
66
|
* Compteur total d'utilisation. Utilisé pour faire ressortir les
|
59
|
67
|
* tags les plus utilisés.
|
60
|
68
|
*
|
|
@@ -106,6 +114,16 @@ class Tag
|
106
|
114
|
{
|
107
|
115
|
return $this->name;
|
108
|
116
|
}
|
|
117
|
+
|
|
118
|
+ public function getSlug()
|
|
119
|
+ {
|
|
120
|
+ return $this->slug;
|
|
121
|
+ }
|
|
122
|
+
|
|
123
|
+ public function setSlug($slug)
|
|
124
|
+ {
|
|
125
|
+ $this->slug = $slug;
|
|
126
|
+ }
|
109
|
127
|
|
110
|
128
|
/**
|
111
|
129
|
* Add elements
|