Completed
Push — master ( c3efa2...a812ec )
by Guilherme
13s
created

Log::getCreatedAt()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * This file is part of the login-cidadao project or it's bundles.
4
 *
5
 * (c) Guilherme Donato <guilhermednt on github>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace LoginCidadao\LogBundle\Entity;
12
13
use Doctrine\ORM\Mapping as ORM;
14
15
/**
16
 * @ORM\Entity
17
 * @ORM\Table(name="log")
18
 * @ORM\HasLifecycleCallbacks
19
 */
20
class Log
21
{
22
    /**
23
     * @ORM\Id
24
     * @ORM\Column(type="integer")
25
     * @ORM\GeneratedValue(strategy="AUTO")
26
     */
27
    private $id;
28
29
    /**
30
     * @ORM\Column(name="message", type="text")
31
     */
32
    private $message;
33
34
    /**
35
     * @ORM\Column(name="context", type="json_array")
36
     */
37
    private $context;
38
39
    /**
40
     * @ORM\Column(name="level", type="smallint")
41
     */
42
    private $level;
43
44
    /**
45
     * @ORM\Column(name="level_name", type="string", length=50)
46
     */
47
    private $levelName;
48
49
    /**
50
     * @ORM\Column(name="extra", type="json_array")
51
     */
52
    private $extra;
53
54
    /**
55
     * @ORM\Column(name="created_at", type="datetime")
56
     */
57
    private $createdAt;
58
59
    /**
60
     * @ORM\PrePersist
61
     */
62
    public function onPrePersist()
63
    {
64
        $this->setCreatedAt(new \DateTime());
65
    }
66
67
    /**
68
     * @return mixed
69
     */
70
    public function getId()
71
    {
72
        return $this->id;
73
    }
74
75
    /**
76
     * @param mixed $id
77
     * @return Log
78
     */
79
    public function setId($id)
80
    {
81
        $this->id = $id;
82
83
        return $this;
84
    }
85
86
    /**
87
     * @return mixed
88
     */
89
    public function getMessage()
90
    {
91
        return $this->message;
92
    }
93
94
    /**
95
     * @param mixed $message
96
     * @return Log
97
     */
98
    public function setMessage($message)
99
    {
100
        $this->message = $message;
101
102
        return $this;
103
    }
104
105
    /**
106
     * @return mixed
107
     */
108
    public function getContext()
109
    {
110
        return $this->context;
111
    }
112
113
    /**
114
     * @param mixed $context
115
     * @return Log
116
     */
117
    public function setContext($context)
118
    {
119
        $this->context = $context;
120
121
        return $this;
122
    }
123
124
    /**
125
     * @return mixed
126
     */
127
    public function getLevel()
128
    {
129
        return $this->level;
130
    }
131
132
    /**
133
     * @param mixed $level
134
     * @return Log
135
     */
136
    public function setLevel($level)
137
    {
138
        $this->level = $level;
139
140
        return $this;
141
    }
142
143
    /**
144
     * @return mixed
145
     */
146
    public function getLevelName()
147
    {
148
        return $this->levelName;
149
    }
150
151
    /**
152
     * @param mixed $levelName
153
     * @return Log
154
     */
155
    public function setLevelName($levelName)
156
    {
157
        $this->levelName = $levelName;
158
159
        return $this;
160
    }
161
162
    /**
163
     * @return mixed
164
     */
165
    public function getExtra()
166
    {
167
        return $this->extra;
168
    }
169
170
    /**
171
     * @param mixed $extra
172
     * @return Log
173
     */
174
    public function setExtra($extra)
175
    {
176
        $this->extra = $extra;
177
178
        return $this;
179
    }
180
181
    /**
182
     * @return mixed
183
     */
184
    public function getCreatedAt()
185
    {
186
        return $this->createdAt;
187
    }
188
189
    /**
190
     * @param mixed $createdAt
191
     * @return Log
192
     */
193
    public function setCreatedAt($createdAt)
194
    {
195
        $this->createdAt = $createdAt;
196
197
        return $this;
198
    }
199
}
200