TranslationModel::getKey()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Sleepness\UberTranslationAdminBundle\Form\Model;
4
5
use Symfony\Component\Validator\Constraints as Assert;
6
7
/**
8
 * Model class for wrapping message translations
9
 *
10
 * @author Viktor Novikov <[email protected]>
11
 */
12
class TranslationModel
13
{
14
    /**
15
     * @Assert\NotBlank()
16
     */
17
    private $locale;
18
19
    /**
20
     * @Assert\NotBlank()
21
     */
22
    private $domain;
23
24
    /**
25
     * @Assert\NotBlank()
26
     */
27
    private $translation;
28
29
    /**
30
     * @Assert\NotBlank()
31
     */
32
    private $key;
33
34
    /**
35
     * TranslationModel constructor
36
     *
37
     * @param string $locale
38
     * @param string $domain
39
     * @param string $key
40
     * @param string $translation
41
     */
42
    public function __construct($locale = null, $domain = null, $key = null, $translation = null)
43
    {
44
        $this->locale = $locale;
45
        $this->domain = $domain;
46
        $this->key = $key;
47
        $this->translation = $translation;
48
    }
49
50
    /**
51
     * @param $locale
52
     * @return $this
53
     */
54
    public function setLocale($locale)
55
    {
56
        $this->locale = $locale;
57
    }
58
59
    /**
60
     * @return mixed
61
     */
62
    public function getLocale()
63
    {
64
        return $this->locale;
65
    }
66
67
    /**
68
     * @param $domain
69
     * @return $this
70
     */
71
    public function setDomain($domain)
72
    {
73
        $this->domain = $domain;
74
    }
75
76
    /**
77
     * @return mixed
78
     */
79
    public function getDomain()
80
    {
81
        return $this->domain;
82
    }
83
84
    /**
85
     * @param $translation
86
     * @return $this
87
     */
88
    public function setTranslation($translation)
89
    {
90
        $this->translation = $translation;
91
92
        return $this;
93
    }
94
95
    /**
96
     * @return mixed
97
     */
98
    public function getTranslation()
99
    {
100
        return $this->translation;
101
    }
102
103
    /**
104
     * @param $key
105
     * @return $this
106
     */
107
    public function setKey($key)
108
    {
109
        $this->key = $key;
110
111
        return $this;
112
    }
113
114
    /**
115
     * @return mixed
116
     */
117
    public function getKey()
118
    {
119
        return $this->key;
120
    }
121
} 
122