1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
* This file is part of the ONGR package. |
5
|
|
|
* |
6
|
|
|
* (c) NFQ Technologies UAB <[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 ONGR\TranslationsBundle\Document; |
13
|
|
|
|
14
|
|
|
use ONGR\ElasticsearchBundle\Annotation as ES; |
15
|
|
|
use ONGR\ElasticsearchBundle\Document\DocumentTrait; |
16
|
|
|
|
17
|
|
|
/** |
18
|
|
|
* Holds translations history. |
19
|
|
|
* |
20
|
|
|
* @ES\Document(type="history") |
21
|
|
|
*/ |
22
|
|
|
class History |
23
|
|
|
{ |
24
|
|
|
use DocumentTrait; |
25
|
|
|
|
26
|
|
|
/** |
27
|
|
|
* @var string |
28
|
|
|
* |
29
|
|
|
* @ES\Property(type="string", options={"index"="not_analyzed"}) |
30
|
|
|
*/ |
31
|
|
|
private $key; |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* @var string |
35
|
|
|
* |
36
|
|
|
* @ES\Property(type="string", options={"index"="not_analyzed"}) |
37
|
|
|
*/ |
38
|
|
|
private $locale; |
39
|
|
|
|
40
|
|
|
/** |
41
|
|
|
* @var string |
42
|
|
|
* |
43
|
|
|
* @ES\Property(type="string", options={"index"="not_analyzed"}) |
44
|
|
|
*/ |
45
|
|
|
private $message; |
46
|
|
|
|
47
|
|
|
/** |
48
|
|
|
* @var string |
49
|
|
|
* |
50
|
|
|
* @ES\Property(type="string", options={"index"="not_analyzed"}) |
51
|
|
|
*/ |
52
|
|
|
private $domain; |
53
|
|
|
|
54
|
|
|
/** |
55
|
|
|
* @var \DateTime |
56
|
|
|
* |
57
|
|
|
* @ES\Property(type="date") |
58
|
|
|
*/ |
59
|
|
|
private $createdAt; |
60
|
|
|
|
61
|
|
|
/** |
62
|
|
|
* Sets timestamps. |
63
|
|
|
*/ |
64
|
|
|
public function __construct() |
65
|
|
|
{ |
66
|
|
|
$this->createdAt = new \DateTime(); |
67
|
|
|
} |
68
|
|
|
|
69
|
|
|
/** |
70
|
|
|
* @param string $key |
71
|
|
|
* |
72
|
|
|
* @return History |
73
|
|
|
*/ |
74
|
|
|
public function setKey($key) |
75
|
|
|
{ |
76
|
|
|
$this->key = $key; |
77
|
|
|
|
78
|
|
|
return $this; |
79
|
|
|
} |
80
|
|
|
|
81
|
|
|
/** |
82
|
|
|
* @return string |
83
|
|
|
*/ |
84
|
|
|
public function getKey() |
85
|
|
|
{ |
86
|
|
|
return $this->key; |
87
|
|
|
} |
88
|
|
|
|
89
|
|
|
/** |
90
|
|
|
* @param string $locale |
91
|
|
|
* |
92
|
|
|
* @return History |
93
|
|
|
*/ |
94
|
|
|
public function setLocale($locale) |
95
|
|
|
{ |
96
|
|
|
$this->locale = $locale; |
97
|
|
|
|
98
|
|
|
return $this; |
99
|
|
|
} |
100
|
|
|
|
101
|
|
|
/** |
102
|
|
|
* @return string |
103
|
|
|
*/ |
104
|
|
|
public function getLocale() |
105
|
|
|
{ |
106
|
|
|
return $this->locale; |
107
|
|
|
} |
108
|
|
|
|
109
|
|
|
/** |
110
|
|
|
* @param string $message |
111
|
|
|
* |
112
|
|
|
* @return History |
113
|
|
|
*/ |
114
|
|
|
public function setMessage($message) |
115
|
|
|
{ |
116
|
|
|
$this->message = $message; |
117
|
|
|
|
118
|
|
|
return $this; |
119
|
|
|
} |
120
|
|
|
|
121
|
|
|
/** |
122
|
|
|
* @return string |
123
|
|
|
*/ |
124
|
|
|
public function getMessage() |
125
|
|
|
{ |
126
|
|
|
return $this->message; |
127
|
|
|
} |
128
|
|
|
|
129
|
|
|
/** |
130
|
|
|
* @param string $domain |
131
|
|
|
* |
132
|
|
|
* @return History |
133
|
|
|
*/ |
134
|
|
|
public function setDomain($domain) |
135
|
|
|
{ |
136
|
|
|
$this->domain = $domain; |
137
|
|
|
|
138
|
|
|
return $this; |
139
|
|
|
} |
140
|
|
|
|
141
|
|
|
/** |
142
|
|
|
* @return string |
143
|
|
|
*/ |
144
|
|
|
public function getDomain() |
145
|
|
|
{ |
146
|
|
|
return $this->domain; |
147
|
|
|
} |
148
|
|
|
|
149
|
|
|
/** |
150
|
|
|
* @return \DateTime |
151
|
|
|
*/ |
152
|
|
|
public function getCreatedAt() |
153
|
|
|
{ |
154
|
|
|
return $this->createdAt; |
155
|
|
|
} |
156
|
|
|
|
157
|
|
|
/** |
158
|
|
|
* @param \DateTime $createdAt |
159
|
|
|
*/ |
160
|
|
|
public function setCreatedAt($createdAt) |
161
|
|
|
{ |
162
|
|
|
$this->createdAt = $createdAt; |
163
|
|
|
} |
164
|
|
|
} |
165
|
|
|
|