1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Webcook\Cms\I18nBundle\Entity; |
4
|
|
|
|
5
|
|
|
use Doctrine\ORM\Mapping as ORM; |
6
|
|
|
use Webcook\Cms\CoreBundle\Base\BasicEntity; |
7
|
|
|
use ApiPlatform\Core\Annotation\ApiResource; |
8
|
|
|
use Symfony\Component\Validator\Constraints as Assert; |
9
|
|
|
|
10
|
|
|
/** |
11
|
|
|
* Translation entity used for translations of strings. |
12
|
|
|
* |
13
|
|
|
* @ORM\Entity |
14
|
|
|
* @ORM\Table(name="Translation") |
15
|
|
|
* @ApiResource |
16
|
|
|
*/ |
17
|
|
|
class Translation extends BasicEntity |
18
|
|
|
{ |
19
|
|
|
/** |
20
|
|
|
* @ORM\Column(name="translation_key", type="string", length=128) |
21
|
|
|
* @Assert\NotBlank |
22
|
|
|
* @Assert\NotNull |
23
|
|
|
*/ |
24
|
|
|
private $key; |
25
|
|
|
|
26
|
|
|
/** |
27
|
|
|
* @ORM\Column(name="catalogue", type="string", length=128) |
28
|
|
|
* @Assert\NotNull |
29
|
|
|
* @Assert\NotBlank |
30
|
|
|
*/ |
31
|
|
|
private $catalogue; |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* @ORM\ManyToOne(targetEntity="Language") |
35
|
|
|
* @Assert\NotNull |
36
|
|
|
*/ |
37
|
|
|
private $language; |
38
|
|
|
|
39
|
|
|
/** |
40
|
|
|
* @ORM\Column(name="translation", type="text") |
41
|
|
|
* @Assert\NotBlank |
42
|
|
|
* @Assert\NotNull |
43
|
|
|
*/ |
44
|
|
|
private $translation; |
45
|
|
|
|
46
|
|
|
/** |
47
|
|
|
* Gets the value of key. |
48
|
|
|
* |
49
|
|
|
* @return mixed |
50
|
|
|
*/ |
51
|
4 |
|
public function getKey() |
52
|
|
|
{ |
53
|
4 |
|
return $this->key; |
54
|
|
|
} |
55
|
|
|
|
56
|
|
|
/** |
57
|
|
|
* Sets the value of key. |
58
|
|
|
* |
59
|
|
|
* @param mixed $key the key |
60
|
|
|
* |
61
|
|
|
* @return self |
62
|
|
|
*/ |
63
|
7 |
|
public function setKey($key) |
64
|
|
|
{ |
65
|
7 |
|
$this->key = $key; |
66
|
|
|
|
67
|
7 |
|
return $this; |
68
|
|
|
} |
69
|
|
|
|
70
|
|
|
/** |
71
|
|
|
* Gets the value of language. |
72
|
|
|
* |
73
|
|
|
* @return mixed |
74
|
|
|
*/ |
75
|
4 |
|
public function getLanguage() |
76
|
|
|
{ |
77
|
4 |
|
return $this->language; |
78
|
|
|
} |
79
|
|
|
|
80
|
|
|
/** |
81
|
|
|
* Sets the value of language. |
82
|
|
|
* |
83
|
|
|
* @param mixed $language the language |
84
|
|
|
* |
85
|
|
|
* @return self |
86
|
|
|
*/ |
87
|
7 |
|
public function setLanguage($language) |
88
|
|
|
{ |
89
|
7 |
|
$this->language = $language; |
90
|
|
|
|
91
|
7 |
|
return $this; |
92
|
|
|
} |
93
|
|
|
|
94
|
|
|
/** |
95
|
|
|
* Gets the value of translation. |
96
|
|
|
* |
97
|
|
|
* @return mixed |
98
|
|
|
*/ |
99
|
4 |
|
public function getTranslation() |
100
|
|
|
{ |
101
|
4 |
|
return $this->translation; |
102
|
|
|
} |
103
|
|
|
|
104
|
|
|
/** |
105
|
|
|
* Sets the value of translation. |
106
|
|
|
* |
107
|
|
|
* @param mixed $translation the translation |
108
|
|
|
* |
109
|
|
|
* @return self |
110
|
|
|
*/ |
111
|
7 |
|
public function setTranslation($translation) |
112
|
|
|
{ |
113
|
7 |
|
$this->translation = $translation; |
114
|
|
|
|
115
|
7 |
|
return $this; |
116
|
|
|
} |
117
|
|
|
|
118
|
|
|
/** |
119
|
|
|
* Gets the value of catalogue. |
120
|
|
|
* |
121
|
|
|
* @return mixed |
122
|
|
|
*/ |
123
|
4 |
|
public function getCatalogue() |
124
|
|
|
{ |
125
|
4 |
|
return $this->catalogue; |
126
|
|
|
} |
127
|
|
|
|
128
|
|
|
/** |
129
|
|
|
* Sets the value of catalogue. |
130
|
|
|
* |
131
|
|
|
* @param mixed $catalogue the catalogue |
132
|
|
|
* |
133
|
|
|
* @return self |
134
|
|
|
*/ |
135
|
7 |
|
public function setCatalogue($catalogue) |
136
|
|
|
{ |
137
|
7 |
|
$this->catalogue = $catalogue; |
138
|
|
|
|
139
|
7 |
|
return $this; |
140
|
|
|
} |
141
|
|
|
} |
142
|
|
|
|