1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
namespace LauLamanApps\ApplePassbookBundle\Event; |
6
|
|
|
|
7
|
|
|
use DateTimeImmutable; |
8
|
|
|
use LauLamanApps\ApplePassbook\Passbook; |
9
|
|
|
|
10
|
|
|
final class RetrieveUpdatedPassbookEvent extends AbstractEvent |
11
|
|
|
{ |
12
|
|
|
/** |
13
|
|
|
* @var string |
14
|
|
|
*/ |
15
|
|
|
private $passTypeIdentifier; |
16
|
|
|
|
17
|
|
|
/** |
18
|
|
|
* @var string |
19
|
|
|
*/ |
20
|
|
|
private $serialNumber; |
21
|
|
|
|
22
|
|
|
/** |
23
|
|
|
* @var string |
24
|
|
|
*/ |
25
|
|
|
private $authenticationToken; |
26
|
|
|
|
27
|
|
|
/** |
28
|
|
|
* @var DateTimeImmutable|null |
29
|
|
|
*/ |
30
|
|
|
private $updatedSince; |
31
|
|
|
|
32
|
|
|
/** |
33
|
|
|
* @var Passbook|null |
34
|
|
|
*/ |
35
|
|
|
private $passbook; |
36
|
|
|
|
37
|
|
|
/** |
38
|
|
|
* @var DateTimeImmutable|null |
39
|
|
|
*/ |
40
|
|
|
private $lastModified; |
41
|
|
|
|
42
|
1 |
|
public function __construct(string $passTypeIdentifier, string $serialNumber, string $authenticationToken, ?DateTimeImmutable $updatedSince = null) |
43
|
|
|
{ |
44
|
1 |
|
parent::__construct(); |
45
|
1 |
|
$this->passTypeIdentifier = $passTypeIdentifier; |
46
|
1 |
|
$this->serialNumber = $serialNumber; |
47
|
1 |
|
$this->authenticationToken = $authenticationToken; |
48
|
1 |
|
$this->updatedSince = $updatedSince; |
49
|
1 |
|
} |
50
|
|
|
|
51
|
1 |
|
public function setPassbook(Passbook $passbook, DateTimeImmutable $lastModified): void |
52
|
|
|
{ |
53
|
1 |
|
$this->successful(); |
54
|
1 |
|
$this->lastModified = $lastModified; |
55
|
1 |
|
$this->passbook = $passbook; |
56
|
1 |
|
} |
57
|
|
|
|
58
|
1 |
|
public function getPassTypeIdentifier(): string |
59
|
|
|
{ |
60
|
1 |
|
return $this->passTypeIdentifier; |
61
|
|
|
} |
62
|
|
|
|
63
|
1 |
|
public function getSerialNumber(): string |
64
|
|
|
{ |
65
|
1 |
|
return $this->serialNumber; |
66
|
|
|
} |
67
|
|
|
|
68
|
1 |
|
public function getAuthenticationToken(): string |
69
|
|
|
{ |
70
|
1 |
|
return $this->authenticationToken; |
71
|
|
|
} |
72
|
|
|
|
73
|
1 |
|
public function getUpdatedSince(): ?DateTimeImmutable |
74
|
|
|
{ |
75
|
1 |
|
return $this->updatedSince; |
76
|
|
|
} |
77
|
|
|
|
78
|
1 |
|
public function getPassbook(): ?Passbook |
79
|
|
|
{ |
80
|
1 |
|
return $this->passbook; |
81
|
|
|
} |
82
|
|
|
|
83
|
1 |
|
public function getLastModified(): ?DateTimeImmutable |
84
|
|
|
{ |
85
|
1 |
|
return $this->lastModified; |
86
|
|
|
} |
87
|
|
|
} |
88
|
|
|
|