1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
namespace LauLamanApps\ApplePassbook\MetaData\SemanticTag\BoardingPass; |
6
|
|
|
|
7
|
|
|
use LauLamanApps\ApplePassbook\MetaData\SemanticTag; |
8
|
|
|
|
9
|
|
|
class PassengerName implements SemanticTag |
10
|
|
|
{ |
11
|
|
|
private string $familyName; |
12
|
|
|
private string $givenName; |
13
|
|
|
private string $middleName; |
14
|
|
|
private string $namePrefix; |
15
|
|
|
private string $nameSuffix; |
16
|
|
|
private string $nickname; |
17
|
|
|
private string $phoneticRepresentation; |
18
|
|
|
|
19
|
|
|
public function setFamilyName(string $familyName): void |
20
|
|
|
{ |
21
|
|
|
$this->familyName = $familyName; |
22
|
|
|
} |
23
|
|
|
|
24
|
|
|
public function setGivenName(string $givenName): void |
25
|
|
|
{ |
26
|
|
|
$this->givenName = $givenName; |
27
|
|
|
} |
28
|
|
|
|
29
|
|
|
public function setMiddleName(string $middleName): void |
30
|
|
|
{ |
31
|
|
|
$this->middleName = $middleName; |
32
|
|
|
} |
33
|
|
|
|
34
|
|
|
public function setNamePrefix(string $namePrefix): void |
35
|
|
|
{ |
36
|
|
|
$this->namePrefix = $namePrefix; |
37
|
|
|
} |
38
|
|
|
|
39
|
|
|
public function setNameSuffix(string $nameSuffix): void |
40
|
|
|
{ |
41
|
|
|
$this->nameSuffix = $nameSuffix; |
42
|
|
|
} |
43
|
|
|
|
44
|
|
|
public function setNickname(string $nickname): void |
45
|
|
|
{ |
46
|
|
|
$this->nickname = $nickname; |
47
|
|
|
} |
48
|
|
|
|
49
|
|
|
public function setPhoneticRepresentation(string $phoneticRepresentation): void |
50
|
|
|
{ |
51
|
|
|
$this->phoneticRepresentation = $phoneticRepresentation; |
52
|
|
|
} |
53
|
|
|
|
54
|
|
|
public function getKey(): string |
55
|
|
|
{ |
56
|
|
|
return 'passengerName'; |
57
|
|
|
} |
58
|
|
|
|
59
|
|
|
/** |
60
|
|
|
* @return array<string, string> |
61
|
|
|
*/ |
62
|
|
|
public function getValue(): array |
63
|
|
|
{ |
64
|
|
|
$data = []; |
65
|
|
|
|
66
|
|
|
if (isset($this->familyName)) { |
67
|
|
|
$data['familyName'] = $this->familyName; |
68
|
|
|
} |
69
|
|
|
|
70
|
|
|
if (isset($this->givenName)) { |
71
|
|
|
$data['givenName'] = $this->givenName; |
72
|
|
|
} |
73
|
|
|
|
74
|
|
|
if (isset($this->middleName)) { |
75
|
|
|
$data['middleName'] = $this->middleName; |
76
|
|
|
} |
77
|
|
|
|
78
|
|
|
if (isset($this->namePrefix)) { |
79
|
|
|
$data['namePrefix'] = $this->namePrefix; |
80
|
|
|
} |
81
|
|
|
|
82
|
|
|
if (isset($this->nameSuffix)) { |
83
|
|
|
$data['nameSuffix'] = $this->nameSuffix; |
84
|
|
|
} |
85
|
|
|
|
86
|
|
|
if (isset($this->nickname)) { |
87
|
|
|
$data['nickname'] = $this->nickname; |
88
|
|
|
} |
89
|
|
|
|
90
|
|
|
if (isset($this->phoneticRepresentation)) { |
91
|
|
|
$data['phoneticRepresentation'] = $this->phoneticRepresentation; |
92
|
|
|
} |
93
|
|
|
|
94
|
|
|
return $data; |
95
|
|
|
} |
96
|
|
|
} |
97
|
|
|
|