Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 8 |
|
0.00% |
0 / 5 |
CRAP | |
0.00% |
0 / 1 |
| LoginSucceedEvent | |
0.00% |
0 / 8 |
|
0.00% |
0 / 5 |
30 | |
0.00% |
0 / 1 |
| __construct | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
| getLogin | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getName | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getTime | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| jsonSerialize | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 | |||
| 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) 2015 (original work) Open Assessment Technologies SA |
| 19 | * |
| 20 | */ |
| 21 | |
| 22 | namespace oat\tao\model\event; |
| 23 | |
| 24 | use JsonSerializable; |
| 25 | use oat\oatbox\event\Event; |
| 26 | |
| 27 | class LoginSucceedEvent implements Event, JsonSerializable |
| 28 | { |
| 29 | private $login = ''; |
| 30 | private $time; |
| 31 | |
| 32 | /** |
| 33 | * LoginEvent constructor. |
| 34 | * @param $login |
| 35 | */ |
| 36 | public function __construct($login = '') |
| 37 | { |
| 38 | $this->login = $login; |
| 39 | $this->time = time(); |
| 40 | } |
| 41 | |
| 42 | /** |
| 43 | * @return string |
| 44 | */ |
| 45 | public function getLogin() |
| 46 | { |
| 47 | return $this->login; |
| 48 | } |
| 49 | |
| 50 | /** |
| 51 | * Return a unique name for this event |
| 52 | * @see \oat\oatbox\event\Event::getName() |
| 53 | */ |
| 54 | public function getName() |
| 55 | { |
| 56 | return __CLASS__; |
| 57 | } |
| 58 | |
| 59 | |
| 60 | /** |
| 61 | * @return \DateTime |
| 62 | */ |
| 63 | public function getTime() |
| 64 | { |
| 65 | return $this->time; |
| 66 | } |
| 67 | |
| 68 | public function jsonSerialize(): array |
| 69 | { |
| 70 | return [ |
| 71 | 'login' => $this->getLogin() |
| 72 | ]; |
| 73 | } |
| 74 | } |