1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace ZpgRtf\Objects; |
4
|
|
|
|
5
|
|
|
/** |
6
|
|
|
* The branch object structures the main branch payload. |
7
|
|
|
*/ |
8
|
|
|
class BranchObject implements \JsonSerializable |
9
|
|
|
{ |
10
|
|
|
/** @var null|string */ |
11
|
|
|
private $branchReference; |
12
|
|
|
|
13
|
|
|
/** @var null|string */ |
14
|
|
|
private $branchName; |
15
|
|
|
|
16
|
|
|
/** @var null|LocationObject */ |
17
|
|
|
private $location; |
18
|
|
|
|
19
|
|
|
/** @var null|string */ |
20
|
|
|
private $telephone; |
21
|
|
|
|
22
|
|
|
/** @var null|string */ |
23
|
|
|
private $email; |
24
|
|
|
|
25
|
|
|
/** @var null|string */ |
26
|
|
|
private $website; |
27
|
|
|
|
28
|
|
|
/** |
29
|
|
|
* @return null|string |
30
|
|
|
*/ |
31
|
6 |
|
public function getBranchReference() |
32
|
|
|
{ |
33
|
6 |
|
return $this->branchReference; |
34
|
|
|
} |
35
|
|
|
|
36
|
|
|
/** |
37
|
|
|
* @param string $branchReference |
38
|
|
|
* |
39
|
|
|
* @return BranchObject |
40
|
|
|
*/ |
41
|
3 |
|
public function setBranchReference(string $branchReference) |
42
|
|
|
{ |
43
|
3 |
|
$this->branchReference = $branchReference; |
44
|
|
|
|
45
|
3 |
|
return $this; |
46
|
|
|
} |
47
|
|
|
|
48
|
|
|
/** |
49
|
|
|
* @return null|string |
50
|
|
|
*/ |
51
|
6 |
|
public function getBranchName() |
52
|
|
|
{ |
53
|
6 |
|
return $this->branchName; |
54
|
|
|
} |
55
|
|
|
|
56
|
|
|
/** |
57
|
|
|
* @param string $branchName |
58
|
|
|
* |
59
|
|
|
* @return BranchObject |
60
|
|
|
*/ |
61
|
2 |
|
public function setBranchName(string $branchName): self |
62
|
|
|
{ |
63
|
2 |
|
$this->branchName = $branchName; |
64
|
|
|
|
65
|
2 |
|
return $this; |
66
|
|
|
} |
67
|
|
|
|
68
|
|
|
/** |
69
|
|
|
* @return null|LocationObject |
70
|
|
|
*/ |
71
|
6 |
|
public function getLocation() |
72
|
|
|
{ |
73
|
6 |
|
return $this->location; |
74
|
|
|
} |
75
|
|
|
|
76
|
|
|
/** |
77
|
|
|
* @param LocationObject $location |
78
|
|
|
* |
79
|
|
|
* @return BranchObject |
80
|
|
|
*/ |
81
|
2 |
|
public function setLocation(LocationObject $location): self |
82
|
|
|
{ |
83
|
2 |
|
$this->location = $location; |
84
|
|
|
|
85
|
2 |
|
return $this; |
86
|
|
|
} |
87
|
|
|
|
88
|
|
|
/** |
89
|
|
|
* @return null|string |
90
|
|
|
*/ |
91
|
6 |
|
public function getTelephone() |
92
|
|
|
{ |
93
|
6 |
|
return $this->telephone; |
94
|
|
|
} |
95
|
|
|
|
96
|
|
|
/** |
97
|
|
|
* @param string $telephone |
98
|
|
|
* |
99
|
|
|
* @return BranchObject |
100
|
|
|
*/ |
101
|
2 |
|
public function setTelephone(string $telephone): self |
102
|
|
|
{ |
103
|
2 |
|
$this->telephone = $telephone; |
104
|
|
|
|
105
|
2 |
|
return $this; |
106
|
|
|
} |
107
|
|
|
|
108
|
|
|
/** |
109
|
|
|
* @return null|string |
110
|
|
|
*/ |
111
|
6 |
|
public function getEmail() |
112
|
|
|
{ |
113
|
6 |
|
return $this->email; |
114
|
|
|
} |
115
|
|
|
|
116
|
|
|
/** |
117
|
|
|
* @param string $email |
118
|
|
|
* |
119
|
|
|
* @return BranchObject |
120
|
|
|
*/ |
121
|
2 |
|
public function setEmail(string $email): self |
122
|
|
|
{ |
123
|
2 |
|
$this->email = $email; |
124
|
|
|
|
125
|
2 |
|
return $this; |
126
|
|
|
} |
127
|
|
|
|
128
|
|
|
/** |
129
|
|
|
* @return null|string |
130
|
|
|
*/ |
131
|
6 |
|
public function getWebsite() |
132
|
|
|
{ |
133
|
6 |
|
return $this->website; |
134
|
|
|
} |
135
|
|
|
|
136
|
|
|
/** |
137
|
|
|
* @param string $website |
138
|
|
|
* |
139
|
|
|
* @return BranchObject |
140
|
|
|
*/ |
141
|
2 |
|
public function setWebsite(string $website): self |
142
|
|
|
{ |
143
|
2 |
|
$this->website = $website; |
144
|
|
|
|
145
|
2 |
|
return $this; |
146
|
|
|
} |
147
|
|
|
|
148
|
|
|
/** {@inheritDoc} */ |
149
|
5 |
|
public function jsonSerialize(): array |
150
|
|
|
{ |
151
|
5 |
|
return array_filter([ |
152
|
5 |
|
'branch_reference' => $this->getBranchReference(), |
153
|
5 |
|
'branch_name' => $this->getBranchName(), |
154
|
5 |
|
'location' => $this->getLocation(), |
155
|
5 |
|
'telephone' => $this->getTelephone(), |
156
|
5 |
|
'email' => $this->getEmail(), |
157
|
5 |
|
'website' => $this->getWebsite(), |
158
|
|
|
]); |
159
|
|
|
} |
160
|
|
|
} |
161
|
|
|
|