Test Failed
Push — release/3.x ( 447600...4272fa )
by
unknown
02:22 queued 10s
created

StaticReferenceTranslation::setLocale()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * @author Rik van der Kemp <[email protected]>
4
 * @copyright Zicht Online <http://zicht.nl>
5
 */
6
7
namespace Zicht\Bundle\UrlBundle\Entity;
8
9
use Doctrine\ORM\Mapping as ORM;
10
11
/**
12
 * StaticReferenceTranslation
13
 *
14
 * @ORM\Table(name="static_reference_translation")
15
 * @ORM\ChangeTrackingPolicy("DEFERRED_EXPLICIT")
16
 * @ORM\Entity
17
 */
18
class StaticReferenceTranslation
19
{
20
    /**
21
     * @var integer
22
     *
23
     * @ORM\Column(name="id", type="integer")
24
     * @ORM\Id
25
     * @ORM\GeneratedValue(strategy="AUTO")
26
     */
27
    private $id;
28
29
    /**
30
     * @ORM\ManyToOne(targetEntity="Zicht\Bundle\UrlBundle\Entity\StaticReference", inversedBy="translations")
31
     */
32
    public $static_reference;
33
34
    /**
35
     * @var string
36
     *
37
     * @ORM\Column(name="url", type="string", length=255, nullable=true)
38
     */
39
    private $url;
40
41
    /**
42
     * @var string
43
     *
44
     * @ORM\Column(name="locale", type="string", length=6, nullable=true)
45
     */
46
    private $locale;
47
48
    /**
49
     * Create a translation
50
     *
51
     * @param string $locale
52
     * @param string $url
53
     */
54
    public function __construct($locale = null, $url = null)
55
    {
56
        $this->locale = $locale;
57
        $this->url    = $url;
58
    }
59
60
    /**
61
     * Get id
62
     *
63
     * @return integer
64
     */
65
    public function getId()
66
    {
67
        return $this->id;
68
    }
69
70
    /**
71
     * @param string $locale
72
     * @return void
73
     */
74
    public function setLocale($locale)
75
    {
76
        $this->locale = strtolower(trim($locale));
77
    }
78
79
    /**
80
     * @return string
81
     */
82
    public function getLocale()
83
    {
84
        return $this->locale;
85
    }
86
87
    /**
88
     * @param mixed $static_reference
89
     * @return void
90
     */
91
    public function setStaticReference($static_reference)
92
    {
93
        $this->static_reference = $static_reference;
94
    }
95
96
    /**
97
     * @param string $url
98
     * @return void
99
     */
100
    public function setUrl($url)
101
    {
102
        $this->url = $url;
103
    }
104
105
    /**
106
     * @return string
107
     */
108
    public function getUrl()
109
    {
110
        return $this->url;
111
    }
112
}
113