Completed
Pull Request — master (#433)
by Paul
11:06 queued 04:27
created

ViewTranslation::setSlug()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 6
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 6
loc 6
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
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 Symfony\Component\Validator\Constraints as Assert;
9
use Knp\DoctrineBehaviors\Model\Translatable\Translation;
10
11
/**
12
 * Victoire ViewTranslation
13
 *
14
 * @ORM\Entity()
15
 * @ORM\Table(name="vic_view_translations")
16
 */
17 View Code Duplication
class ViewTranslation
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
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