Completed
Push — master ( 5d51b4...87fdd9 )
by Paul
10s
created

ViewTranslation::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 2
Metric Value
dl 0
loc 6
rs 9.4285
c 2
b 0
f 2
cc 1
eloc 4
nc 1
nop 3
1
<?php
2
3
namespace Victoire\Bundle\I18nBundle\Entity;
4
5
use Doctrine\ORM\Mapping as ORM;
6
use Gedmo\Mapping\Annotation as Gedmo;
7
use JMS\Serializer\Annotation as Serializer;
8
use Knp\DoctrineBehaviors\Model\Translatable\Translation;
9
use Symfony\Component\Validator\Constraints as Assert;
10
11
/**
12
 * Victoire ViewTranslation.
13
 *
14
 * @ORM\Entity()
15
 * @ORM\Table(name="vic_view_translations")
16
 */
17
class ViewTranslation
18
{
19
    use Translation;
20
21
    /**
22
     * @var string
23
     *
24
     * @Assert\NotBlank()
25
     * @ORM\Column(name="name", type="string", length=255)
26
     * @Serializer\Groups({"search"})
27
     */
28
    protected $name;
29
30
    /**
31
     * @var string
32
     *
33
     * @Gedmo\Slug(handlers={
34
     *     @Gedmo\SlugHandler(class="Victoire\Bundle\BusinessEntityBundle\Handler\TwigSlugHandler"
35
     * )},fields={"name"}, updatable=false, unique=false)
36
     * @ORM\Column(name="slug", type="string", length=255)
37
     */
38
    protected $slug;
39
40
    /**
41
     * @var string
42
     *             This property is computed by the method PageSubscriber::buildUrl
43
     */
44
    protected $url;
45
46
    /**
47
     * Get name.
48
     *
49
     * @return string
50
     */
51
    public function getName()
52
    {
53
        return $this->name;
54
    }
55
56
    /**
57
     * Set name.
58
     *
59
     * @param string $name
60
     *
61
     * @return View
62
     */
63
    public function setName($name)
64
    {
65
        $this->name = $name;
66
67
        return $this;
68
    }
69
70
    /**
71
     * Set slug.
72
     *
73
     * @param string $slug
74
     *
75
     * @return View
76
     */
77
    public function setSlug($slug)
78
    {
79
        $this->slug = $slug;
80
81
        return $this;
82
    }
83
84
    /**
85
     * Get slug.
86
     *
87
     * @return string
88
     */
89
    public function getSlug()
90
    {
91
        return $this->slug;
92
    }
93
94
    /**
95
     * @return string
96
     */
97
    public function getUrl()
98
    {
99
        return $this->url;
100
    }
101
102
    /**
103
     * @param string $url
104
     */
105
    public function setUrl($url)
106
    {
107
        $this->url = $url;
108
109
        return $this;
110
    }
111
112
    /**
113
     * {@inheritdoc}
114
     */
115
    public static function getTranslatableEntityClass()
116
    {
117
        return '\\Victoire\\Bundle\\CoreBundle\\Entity\\View';
118
    }
119
}
120