|
1 | 1 | <?php
|
2 | 2 |
|
3 |
| -namespace Surfnet\Stepup\Identity\Entity; |
| 3 | +namespace Surfnet\Stepup\Configuration\Entity; |
4 | 4 |
|
5 | 5 | use Surfnet\Stepup\Configuration\Value\ContactInformation;
|
6 | 6 | use Surfnet\Stepup\Configuration\Value\Institution;
|
|
10 | 10 |
|
11 | 11 | class RaLocation
|
12 | 12 | {
|
| 13 | + /** |
| 14 | + * @var RaLocationId |
| 15 | + */ |
| 16 | + private $raLocationId; |
| 17 | + |
13 | 18 | /**
|
14 | 19 | * @var RaLocationName
|
15 | 20 | */
|
16 | 21 | private $locationName;
|
17 | 22 |
|
18 | 23 | /**
|
19 |
| - * @var RaLocationId |
| 24 | + * @var Location |
20 | 25 | */
|
21 |
| - private $raLocationId; |
| 26 | + private $location; |
22 | 27 |
|
23 | 28 | /**
|
24 | 29 | * @var ContactInformation
|
25 | 30 | */
|
26 | 31 | private $contactInformation;
|
27 | 32 |
|
28 | 33 | /**
|
29 |
| - * @var Institution |
| 34 | + * @param RaLocationId $raLocationId |
| 35 | + * @param RaLocationName $raLocationName |
| 36 | + * @param Location $location |
| 37 | + * @param ContactInformation $contactInformation |
| 38 | + * @return RaLocation |
30 | 39 | */
|
31 |
| - private $institution; |
32 |
| - |
33 |
| - /** |
34 |
| - * @var Location |
35 |
| - */ |
36 |
| - private $location; |
| 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 | + } |
37 | 48 |
|
38 |
| - public function __construct( |
| 49 | + private function __construct( |
39 | 50 | RaLocationId $raLocationId,
|
40 |
| - Institution $institution, |
41 | 51 | RaLocationName $locationName,
|
42 | 52 | Location $location,
|
43 | 53 | ContactInformation $contactInformation
|
44 | 54 | ) {
|
45 | 55 | $this->raLocationId = $raLocationId;
|
46 |
| - $this->institution = $institution; |
47 | 56 | $this->locationName = $locationName;
|
48 | 57 | $this->location = $location;
|
49 | 58 | $this->contactInformation = $contactInformation;
|
50 | 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 | + } |
51 | 97 | }
|
0 commit comments