Completed
Push — master ( b220cf...77a24b )
by Simonas
104:16 queued 39:36
created

History::setId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
c 1
b 1
f 0
dl 0
loc 6
rs 9.4286
cc 1
eloc 3
nc 1
nop 1
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
16
/**
17
 * Holds translations history.
18
 *
19
 * @ES\Document(type="history")
20
 */
21
class History
22
{
23
    /**
24
     * @var string
25
     *
26
     * @ES\Id()
27
     */
28
    private $id;
29
30
    /**
31
     * @var string
32
     *
33
     * @ES\Property(type="string", options={"index"="not_analyzed"})
34
     */
35
    private $key;
36
37
    /**
38
     * @var string
39
     *
40
     * @ES\Property(type="string", options={"index"="not_analyzed"})
41
     */
42
    private $locale;
43
44
    /**
45
     * @var string
46
     *
47
     * @ES\Property(type="string", options={"index"="not_analyzed"})
48
     */
49
    private $message;
50
51
    /**
52
     * @var string
53
     *
54
     * @ES\Property(type="string", options={"index"="not_analyzed"})
55
     */
56
    private $domain;
57
58
    /**
59
     * @var \DateTime
60
     *
61
     * @ES\Property(type="date")
62
     */
63
    private $createdAt;
64
65
    /**
66
     * Sets timestamps.
67
     */
68
    public function __construct()
69
    {
70
        $this->createdAt = new \DateTime();
71
    }
72
73
    /**
74
     * Sets document ID.
75
     *
76
     * @param string $id
77
     *
78
     * @return $this
79
     */
80
    public function setId($id)
81
    {
82
        $this->id = $id;
83
84
        return $this;
85
    }
86
87
    /**
88
     * Returns document ID.
89
     *
90
     * @return string
91
     */
92
    public function getId()
93
    {
94
        return $this->id;
95
    }
96
97
    /**
98
     * @param string $key
99
     *
100
     * @return History
101
     */
102
    public function setKey($key)
103
    {
104
        $this->key = $key;
105
106
        return $this;
107
    }
108
109
    /**
110
     * @return string
111
     */
112
    public function getKey()
113
    {
114
        return $this->key;
115
    }
116
117
    /**
118
     * @param string $locale
119
     *
120
     * @return History
121
     */
122
    public function setLocale($locale)
123
    {
124
        $this->locale = $locale;
125
126
        return $this;
127
    }
128
129
    /**
130
     * @return string
131
     */
132
    public function getLocale()
133
    {
134
        return $this->locale;
135
    }
136
137
    /**
138
     * @param string $message
139
     *
140
     * @return History
141
     */
142
    public function setMessage($message)
143
    {
144
        $this->message = $message;
145
146
        return $this;
147
    }
148
149
    /**
150
     * @return string
151
     */
152
    public function getMessage()
153
    {
154
        return $this->message;
155
    }
156
157
    /**
158
     * @param string $domain
159
     *
160
     * @return History
161
     */
162
    public function setDomain($domain)
163
    {
164
        $this->domain = $domain;
165
166
        return $this;
167
    }
168
169
    /**
170
     * @return string
171
     */
172
    public function getDomain()
173
    {
174
        return $this->domain;
175
    }
176
177
    /**
178
     * @return \DateTime
179
     */
180
    public function getCreatedAt()
181
    {
182
        return $this->createdAt;
183
    }
184
185
    /**
186
     * @param \DateTime $createdAt
187
     */
188
    public function setCreatedAt($createdAt)
189
    {
190
        $this->createdAt = $createdAt;
191
    }
192
}
193