Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
10 / 10 |
|
100.00% |
6 / 6 |
CRAP | |
100.00% |
1 / 1 |
LogEntity | |
100.00% |
10 / 10 |
|
100.00% |
6 / 6 |
6 | |
100.00% |
1 / 1 |
__construct | |
100.00% |
5 / 5 |
|
100.00% |
1 / 1 |
1 | |||
getEvent | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getAction | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getUser | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getTime | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getData | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 |
1 | <?php |
2 | |
3 | /** |
4 | * This program is free software; you can redistribute it and/or |
5 | * modify it under the terms of the GNU General Public License |
6 | * as published by the Free Software Foundation; under version 2 |
7 | * of the License (non-upgradable). |
8 | * |
9 | * This program is distributed in the hope that it will be useful, |
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | * GNU General Public License for more details. |
13 | * |
14 | * You should have received a copy of the GNU General Public License |
15 | * along with this program; if not, write to the Free Software |
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
17 | * |
18 | * Copyright (c) 2017 (original work) Open Assessment Technologies SA; |
19 | */ |
20 | |
21 | namespace oat\taoEventLog\model; |
22 | |
23 | use oat\oatbox\event\Event; |
24 | use oat\oatbox\user\User; |
25 | use oat\dtms\DateTime; |
26 | |
27 | /** |
28 | * Class LogEntity |
29 | * @package oat\taoEventLog\model |
30 | * @author Aleh Hutnikau, <hutnikau@1pt.com> |
31 | */ |
32 | class LogEntity |
33 | { |
34 | /** @var Event */ |
35 | protected $event; |
36 | |
37 | /** @var string */ |
38 | protected $action; |
39 | |
40 | /** @var User */ |
41 | protected $user; |
42 | |
43 | /** @var DateTime */ |
44 | protected $time; |
45 | |
46 | /** @var array */ |
47 | protected $data; |
48 | |
49 | /** |
50 | * @param Event $event |
51 | * @param string $action |
52 | * @param User $user |
53 | * @param DateTime $time |
54 | * @param array $data |
55 | */ |
56 | public function __construct(Event $event, $action, User $user, DateTime $time, $data = []) |
57 | { |
58 | $this->event = $event; |
59 | $this->action = $action; |
60 | $this->user = $user; |
61 | $this->time = $time; |
62 | $this->data = $data; |
63 | } |
64 | |
65 | /** |
66 | * @return Event |
67 | */ |
68 | public function getEvent() |
69 | { |
70 | return $this->event; |
71 | } |
72 | |
73 | /** |
74 | * @return string |
75 | */ |
76 | public function getAction() |
77 | { |
78 | return $this->action; |
79 | } |
80 | |
81 | /** |
82 | * @return User |
83 | */ |
84 | public function getUser() |
85 | { |
86 | return $this->user; |
87 | } |
88 | |
89 | /** |
90 | * @return DateTime |
91 | */ |
92 | public function getTime() |
93 | { |
94 | return $this->time; |
95 | } |
96 | |
97 | /** |
98 | * @return array |
99 | */ |
100 | public function getData() |
101 | { |
102 | return $this->data; |
103 | } |
104 | } |