Test Setup Failed
Push — master ( ef9069...17042f )
by Craig
05:56
created

ActiveUserPostDeletedEvent::__construct()   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 2
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the Zikula package.
7
 *
8
 * Copyright Zikula - 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 the deletion of a user account.
20
 * This is a storage-level event, not a UI event. It should not be used for UI-level actions such as redirects.
21
 */
22
class ActiveUserPostDeletedEvent extends UserEntityEvent
23
{
24
    /**
25
     * Has the user been fully deleted (true) or converted to ghost (false)
26
     * In general, listening extensions should respond the same in both cases - removing all private user data.
27
     * When converted to ghost, it is acceptable to retain the UID as the source of data if needed, as the UID
28
     * will continue to remain valid and reference a UserEntity record.
29
     * @var bool
30
     */
31
    private $fullDeletion;
32
33
    public function __construct(?UserEntity $user, bool $fullDeletion = false)
34
    {
35
        parent::__construct($user);
36
        $this->fullDeletion = $fullDeletion;
37
    }
38
39
    public function isFullDeletion(): bool
40
    {
41
        return $this->fullDeletion;
42
    }
43
}
44