1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
* This file is part of the haveibeenpwned-bundle package. |
5
|
|
|
* |
6
|
|
|
* (c) 2019 WEBEWEB |
7
|
|
|
* |
8
|
|
|
* For the full copyright and license information, please view the LICENSE |
9
|
|
|
* file that was distributed with this source code. |
10
|
|
|
*/ |
11
|
|
|
|
12
|
|
|
namespace WBW\Bundle\HaveIBeenPwnedBundle\Event; |
13
|
|
|
|
14
|
|
|
use WBW\Library\HaveIBeenPwned\Entity\BreachedAccountInterface; |
15
|
|
|
use WBW\Library\HaveIBeenPwned\Model\Request\BreachedAccountRequest; |
16
|
|
|
use WBW\Library\HaveIBeenPwned\Model\Response\BreachesResponse; |
17
|
|
|
|
18
|
|
|
/** |
19
|
|
|
* Breached account event. |
20
|
|
|
* |
21
|
|
|
* @author webeweb <https://github.com/webeweb/> |
22
|
|
|
* @package WBW\Bundle\HaveIBeenPwnedBundle\Event |
23
|
|
|
*/ |
24
|
|
|
class BreachedAccountEvent extends AbstractEvent { |
25
|
|
|
|
26
|
|
|
/** |
27
|
|
|
* Constructor. |
28
|
|
|
* |
29
|
|
|
* @param BreachedAccountInterface $entity The breached account. |
30
|
|
|
*/ |
31
|
|
|
public function __construct(BreachedAccountInterface $entity) { |
32
|
|
|
parent::__construct(HaveIBeenPwnedEvents::BREACHED_ACCOUNT, $entity); |
33
|
|
|
} |
34
|
|
|
|
35
|
|
|
/** |
36
|
|
|
* Get the breached account. |
37
|
|
|
* |
38
|
|
|
* @return BreachedAccountInterface Returns the breached account. |
39
|
|
|
*/ |
40
|
|
|
public function getBreachedAccount() { |
41
|
|
|
return $this->getEntity(); |
42
|
|
|
} |
43
|
|
|
|
44
|
|
|
/** |
45
|
|
|
* Get the breached account request. |
46
|
|
|
* |
47
|
|
|
* @return BreachedAccountRequest Returns the breached account request. |
48
|
|
|
*/ |
49
|
|
|
public function getRequest() { |
50
|
|
|
return parent::getRequest(); |
51
|
|
|
} |
52
|
|
|
|
53
|
|
|
/** |
54
|
|
|
* Get the breaches response. |
55
|
|
|
* |
56
|
|
|
* @return BreachesResponse Returns the breaches response. |
57
|
|
|
*/ |
58
|
|
|
public function getResponse() { |
59
|
|
|
return parent::getResponse(); |
60
|
|
|
} |
61
|
|
|
} |
62
|
|
|
|