|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Surfnet\Stepup\Configuration\Entity; |
|
4
|
|
|
|
|
5
|
|
|
use Surfnet\Stepup\Configuration\Value\ContactInformation; |
|
6
|
|
|
use Surfnet\Stepup\Configuration\Value\Institution; |
|
7
|
|
|
use Surfnet\Stepup\Configuration\Value\Location; |
|
8
|
|
|
use Surfnet\Stepup\Configuration\Value\RaLocationId; |
|
9
|
|
|
use Surfnet\Stepup\Configuration\Value\RaLocationName; |
|
10
|
|
|
|
|
11
|
|
|
class RaLocation |
|
|
|
|
|
|
12
|
|
|
{ |
|
13
|
|
|
/** |
|
14
|
|
|
* @var RaLocationId |
|
15
|
|
|
*/ |
|
16
|
|
|
private $raLocationId; |
|
17
|
|
|
|
|
18
|
|
|
/** |
|
19
|
|
|
* @var RaLocationName |
|
20
|
|
|
*/ |
|
21
|
|
|
private $locationName; |
|
22
|
|
|
|
|
23
|
|
|
/** |
|
24
|
|
|
* @var Location |
|
25
|
|
|
*/ |
|
26
|
|
|
private $location; |
|
27
|
|
|
|
|
28
|
|
|
/** |
|
29
|
|
|
* @var ContactInformation |
|
30
|
|
|
*/ |
|
31
|
|
|
private $contactInformation; |
|
32
|
|
|
|
|
33
|
|
|
/** |
|
34
|
|
|
* @param RaLocationId $raLocationId |
|
35
|
|
|
* @param RaLocationName $raLocationName |
|
36
|
|
|
* @param Location $location |
|
37
|
|
|
* @param ContactInformation $contactInformation |
|
38
|
|
|
* @return RaLocation |
|
39
|
|
|
*/ |
|
40
|
|
|
public static function create( |
|
41
|
|
|
RaLocationId $raLocationId, |
|
42
|
|
|
RaLocationName $raLocationName, |
|
43
|
|
|
Location $location, |
|
44
|
|
|
ContactInformation $contactInformation |
|
45
|
|
|
) { |
|
46
|
|
|
return new self($raLocationId, $raLocationName, $location, $contactInformation); |
|
47
|
|
|
} |
|
48
|
|
|
|
|
49
|
|
|
private function __construct( |
|
50
|
|
|
RaLocationId $raLocationId, |
|
51
|
|
|
RaLocationName $locationName, |
|
52
|
|
|
Location $location, |
|
53
|
|
|
ContactInformation $contactInformation |
|
54
|
|
|
) { |
|
55
|
|
|
$this->raLocationId = $raLocationId; |
|
56
|
|
|
$this->locationName = $locationName; |
|
57
|
|
|
$this->location = $location; |
|
58
|
|
|
$this->contactInformation = $contactInformation; |
|
59
|
|
|
} |
|
60
|
|
|
|
|
61
|
|
|
public function hasRaLocationId(RaLocationId $raLocationId) |
|
62
|
|
|
{ |
|
63
|
|
|
return $this->raLocationId->equals($raLocationId); |
|
64
|
|
|
} |
|
65
|
|
|
|
|
66
|
|
|
/** |
|
67
|
|
|
* @return RaLocationId |
|
68
|
|
|
*/ |
|
69
|
|
|
public function getRaLocationId() |
|
70
|
|
|
{ |
|
71
|
|
|
return $this->raLocationId; |
|
72
|
|
|
} |
|
73
|
|
|
|
|
74
|
|
|
/** |
|
75
|
|
|
* @return RaLocationName |
|
76
|
|
|
*/ |
|
77
|
|
|
public function getLocationName() |
|
78
|
|
|
{ |
|
79
|
|
|
return $this->locationName; |
|
80
|
|
|
} |
|
81
|
|
|
|
|
82
|
|
|
/** |
|
83
|
|
|
* @return Location |
|
84
|
|
|
*/ |
|
85
|
|
|
public function getLocation() |
|
86
|
|
|
{ |
|
87
|
|
|
return $this->location; |
|
88
|
|
|
} |
|
89
|
|
|
|
|
90
|
|
|
/** |
|
91
|
|
|
* @return ContactInformation |
|
92
|
|
|
*/ |
|
93
|
|
|
public function getContactInformation() |
|
94
|
|
|
{ |
|
95
|
|
|
return $this->contactInformation; |
|
96
|
|
|
} |
|
97
|
|
|
} |
|
98
|
|
|
|