1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
* This file is part of the AsmTranslationLoaderBundle package. |
5
|
|
|
* |
6
|
|
|
* (c) Marc Aschmann <[email protected]> |
7
|
|
|
* |
8
|
|
|
* For the full copyright and license information, please view the LICENSE |
9
|
|
|
* file that was distributed with this source code. |
10
|
|
|
*/ |
11
|
|
|
|
12
|
|
|
namespace Asm\TranslationLoaderBundle\Model; |
13
|
|
|
|
14
|
|
|
/** |
15
|
|
|
* Base implementation of the {@link TranslationHistoryInterface} (can be extended |
16
|
|
|
* by concrete storage layer implementations). |
17
|
|
|
* |
18
|
|
|
* @author Christian Flothmann <[email protected]> |
19
|
|
|
*/ |
20
|
|
|
abstract class TranslationHistory implements TranslationHistoryInterface |
21
|
|
|
{ |
22
|
|
|
/** |
23
|
|
|
* @var int |
24
|
|
|
*/ |
25
|
|
|
protected $id; |
26
|
|
|
|
27
|
|
|
/** |
28
|
|
|
* @var string |
29
|
|
|
*/ |
30
|
|
|
protected $transKey; |
31
|
|
|
|
32
|
|
|
/** |
33
|
|
|
* @var string |
34
|
|
|
*/ |
35
|
|
|
protected $transLocale; |
36
|
|
|
|
37
|
|
|
/** |
38
|
|
|
* @var string |
39
|
|
|
*/ |
40
|
|
|
protected $messageDomain; |
41
|
|
|
|
42
|
|
|
/** |
43
|
|
|
* @var string |
44
|
|
|
*/ |
45
|
|
|
protected $userName; |
46
|
|
|
|
47
|
|
|
/** |
48
|
|
|
* @var string |
49
|
|
|
*/ |
50
|
|
|
protected $userAction; |
51
|
|
|
|
52
|
|
|
/** |
53
|
|
|
* @var string |
54
|
|
|
*/ |
55
|
|
|
protected $translation; |
56
|
|
|
|
57
|
|
|
/** |
58
|
|
|
* @var \DateTime |
59
|
|
|
*/ |
60
|
|
|
protected $dateOfChange; |
61
|
|
|
|
62
|
|
|
/** |
63
|
|
|
* {@inheritDoc} |
64
|
|
|
*/ |
65
|
1 |
|
public function getId() |
66
|
|
|
{ |
67
|
1 |
|
return $this->id; |
68
|
|
|
} |
69
|
|
|
|
70
|
|
|
/** |
71
|
|
|
* {@inheritDoc} |
72
|
|
|
*/ |
73
|
7 |
|
public function setDateOfChange(\DateTime $dateOfChange = null) |
74
|
|
|
{ |
75
|
7 |
|
if (empty($dateOfChange)) { |
76
|
1 |
|
$dateOfChange = new \DateTime(); |
77
|
1 |
|
} |
78
|
7 |
|
$this->dateOfChange = $dateOfChange; |
79
|
7 |
|
} |
80
|
|
|
|
81
|
|
|
/** |
82
|
|
|
* {@inheritDoc} |
83
|
|
|
*/ |
84
|
7 |
|
public function getDateOfChange() |
85
|
|
|
{ |
86
|
7 |
|
return $this->dateOfChange; |
87
|
|
|
} |
88
|
|
|
|
89
|
|
|
/** |
90
|
|
|
* {@inheritDoc} |
91
|
|
|
*/ |
92
|
7 |
|
public function setMessageDomain($messageDomain) |
93
|
|
|
{ |
94
|
7 |
|
$this->messageDomain = $messageDomain; |
95
|
7 |
|
} |
96
|
|
|
|
97
|
|
|
/** |
98
|
|
|
* {@inheritDoc} |
99
|
|
|
*/ |
100
|
7 |
|
public function getMessageDomain() |
101
|
|
|
{ |
102
|
7 |
|
return $this->messageDomain; |
103
|
|
|
} |
104
|
|
|
|
105
|
|
|
/** |
106
|
|
|
* {@inheritDoc} |
107
|
|
|
*/ |
108
|
7 |
|
public function setTransKey($transKey) |
109
|
|
|
{ |
110
|
7 |
|
$this->transKey = $transKey; |
111
|
7 |
|
} |
112
|
|
|
|
113
|
|
|
/** |
114
|
|
|
* {@inheritDoc} |
115
|
|
|
*/ |
116
|
7 |
|
public function getTransKey() |
117
|
|
|
{ |
118
|
7 |
|
return $this->transKey; |
119
|
|
|
} |
120
|
|
|
|
121
|
|
|
/** |
122
|
|
|
* {@inheritDoc} |
123
|
|
|
*/ |
124
|
7 |
|
public function setTransLocale($transLocale) |
125
|
|
|
{ |
126
|
7 |
|
$this->transLocale = $transLocale; |
127
|
7 |
|
} |
128
|
|
|
|
129
|
|
|
/** |
130
|
|
|
* {@inheritDoc} |
131
|
|
|
*/ |
132
|
7 |
|
public function getTransLocale() |
133
|
|
|
{ |
134
|
7 |
|
return $this->transLocale; |
135
|
|
|
} |
136
|
|
|
|
137
|
|
|
/** |
138
|
|
|
* {@inheritDoc} |
139
|
|
|
*/ |
140
|
7 |
|
public function setTranslation($translation) |
141
|
|
|
{ |
142
|
7 |
|
$this->translation = $translation; |
143
|
7 |
|
} |
144
|
|
|
|
145
|
|
|
/** |
146
|
|
|
* {@inheritDoc} |
147
|
|
|
*/ |
148
|
7 |
|
public function getTranslation() |
149
|
|
|
{ |
150
|
7 |
|
return $this->translation; |
151
|
|
|
} |
152
|
|
|
|
153
|
|
|
/** |
154
|
|
|
* {@inheritDoc} |
155
|
|
|
*/ |
156
|
7 |
|
public function setUserAction($userAction) |
157
|
|
|
{ |
158
|
7 |
|
$this->userAction = $userAction; |
159
|
7 |
|
} |
160
|
|
|
|
161
|
|
|
/** |
162
|
|
|
* {@inheritDoc} |
163
|
|
|
*/ |
164
|
7 |
|
public function getUserAction() |
165
|
|
|
{ |
166
|
7 |
|
return $this->userAction; |
167
|
|
|
} |
168
|
|
|
|
169
|
|
|
/** |
170
|
|
|
* {@inheritDoc} |
171
|
|
|
*/ |
172
|
7 |
|
public function setUserName($userName = 'anonymous') |
173
|
|
|
{ |
174
|
7 |
|
$this->userName = $userName; |
175
|
7 |
|
} |
176
|
|
|
|
177
|
|
|
/** |
178
|
|
|
* {@inheritDoc} |
179
|
|
|
*/ |
180
|
7 |
|
public function getUserName() |
181
|
|
|
{ |
182
|
7 |
|
return $this->userName; |
183
|
|
|
} |
184
|
|
|
} |
185
|
|
|
|