Completed
Pull Request — master (#4192)
by Craig
05:08
created

DeletedRegistrationEvent::getDate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the Zikula package.
7
 *
8
 * Copyright Zikula Foundation - https://ziku.la/
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Zikula\UsersModule\Event;
15
16
use Zikula\UsersModule\Entity\UserEntity;
17
18
/**
19
 * Occurs after a registration record is deleted. This could occur as a result of the administrator deleting the
20
 * record through the approval/denial process, or it could happen because the registration request expired. This
21
 * event will not fire if a registration record is converted to a full user account record. Instead, a
22
 * `user.account.create` event will fire. This is a storage-level event, not a UI event. It should not be used for
23
 * UI-level actions such as redirects.
24
 * The subject of the event is set to the Uid being deleted.
25
 */
26
class DeletedRegistrationEvent
27
{
28
    /**
29
     * @var UserEntity
30
     */
31
    private $user;
32
33
    /**
34
     * @var \DateTimeImmutable
35
     */
36
    private $date;
37
38
    public function __construct(UserEntity $user)
39
    {
40
        $this->user = $user;
41
        $this->date = new \DateTimeImmutable('now');
42
    }
43
44
    public function getUser(): UserEntity
45
    {
46
        return $this->user;
47
    }
48
49
    public function getDate(): \DateTimeImmutable
50
    {
51
        return $this->date;
52
    }
53
}
54