1
|
|
|
<?php |
2
|
|
|
declare(strict_types=1); |
3
|
|
|
|
4
|
|
|
namespace Eekes\VblApi\Entity; |
5
|
|
|
|
6
|
|
|
class Club |
7
|
|
|
{ |
8
|
|
|
private ?string $id; |
9
|
|
|
private ?string $matricule; |
10
|
|
|
private string $name; |
11
|
|
|
private ?string $place; |
12
|
|
|
private ?string $email; |
13
|
|
|
private ?string $website; |
14
|
|
|
private Address $address; |
15
|
|
|
|
16
|
|
|
private BoardMemberCollection $boardMembers; |
17
|
|
|
private AccommodationCollection $accommodations; |
18
|
|
|
private ClubTeamCollection $teams; |
19
|
|
|
|
20
|
|
|
public static function createFromResponse(\stdClass $response): self |
21
|
|
|
{ |
22
|
|
|
$club = new self(); |
23
|
|
|
|
24
|
|
|
$club->id = $response->guid; |
25
|
|
|
$club->matricule = $response->stamNr; |
26
|
|
|
$club->name = $response->naam; |
27
|
|
|
$club->place = $response->plaats; |
28
|
|
|
$club->email = $response->email; |
29
|
|
|
$club->website = $response->website; |
30
|
|
|
|
31
|
|
|
$club->address = Address::createFromResponse($response->adres); |
32
|
|
|
$club->boardMembers = BoardMemberCollection::createFromArrayResponse($response->bestuur); |
33
|
|
|
$club->accommodations = AccommodationCollection::createFromArrayResponse($response->accomms); |
34
|
|
|
$club->teams = ClubTeamCollection::createFromArrayResponse($response->teams); |
35
|
|
|
|
36
|
|
|
return $club; |
37
|
|
|
} |
38
|
|
|
|
39
|
|
|
public function getId(): ?string |
40
|
|
|
{ |
41
|
|
|
return $this->id; |
42
|
|
|
} |
43
|
|
|
|
44
|
|
|
public function getMatricule(): ?string |
45
|
|
|
{ |
46
|
|
|
return $this->matricule; |
47
|
|
|
} |
48
|
|
|
|
49
|
|
|
public function getName(): string |
50
|
|
|
{ |
51
|
|
|
return $this->name; |
52
|
|
|
} |
53
|
|
|
|
54
|
|
|
public function getPlace(): ?string |
55
|
|
|
{ |
56
|
|
|
return $this->place; |
57
|
|
|
} |
58
|
|
|
|
59
|
|
|
public function getBoardMembers(): BoardMemberCollection |
60
|
|
|
{ |
61
|
|
|
return $this->boardMembers; |
62
|
|
|
} |
63
|
|
|
|
64
|
|
|
public function getAccommodations(): AccommodationCollection |
65
|
|
|
{ |
66
|
|
|
return $this->accommodations; |
67
|
|
|
} |
68
|
|
|
|
69
|
|
|
public function getEmail(): ?string |
70
|
|
|
{ |
71
|
|
|
return $this->email; |
72
|
|
|
} |
73
|
|
|
|
74
|
|
|
public function getWebsite(): ?string |
75
|
|
|
{ |
76
|
|
|
return $this->website; |
77
|
|
|
} |
78
|
|
|
|
79
|
|
|
public function getAddress(): Address |
80
|
|
|
{ |
81
|
|
|
return $this->address; |
82
|
|
|
} |
83
|
|
|
|
84
|
|
|
public function getTeams(): ClubTeamCollection |
85
|
|
|
{ |
86
|
|
|
return $this->teams; |
87
|
|
|
} |
88
|
|
|
} |