Skip to content

Commit 3a219f0

Browse files
author
Alex Rothuis
committed
Update RaLocation: remove institute from methods, add accessor
1 parent 4d1c514 commit 3a219f0

File tree

1 file changed

+59
-13
lines changed

1 file changed

+59
-13
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace Surfnet\Stepup\Identity\Entity;
3+
namespace Surfnet\Stepup\Configuration\Entity;
44

55
use Surfnet\Stepup\Configuration\Value\ContactInformation;
66
use Surfnet\Stepup\Configuration\Value\Institution;
@@ -10,42 +10,88 @@
1010

1111
class RaLocation
1212
{
13+
/**
14+
* @var RaLocationId
15+
*/
16+
private $raLocationId;
17+
1318
/**
1419
* @var RaLocationName
1520
*/
1621
private $locationName;
1722

1823
/**
19-
* @var RaLocationId
24+
* @var Location
2025
*/
21-
private $raLocationId;
26+
private $location;
2227

2328
/**
2429
* @var ContactInformation
2530
*/
2631
private $contactInformation;
2732

2833
/**
29-
* @var Institution
34+
* @param RaLocationId $raLocationId
35+
* @param RaLocationName $raLocationName
36+
* @param Location $location
37+
* @param ContactInformation $contactInformation
38+
* @return RaLocation
3039
*/
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+
}
3748

38-
public function __construct(
49+
private function __construct(
3950
RaLocationId $raLocationId,
40-
Institution $institution,
4151
RaLocationName $locationName,
4252
Location $location,
4353
ContactInformation $contactInformation
4454
) {
4555
$this->raLocationId = $raLocationId;
46-
$this->institution = $institution;
4756
$this->locationName = $locationName;
4857
$this->location = $location;
4958
$this->contactInformation = $contactInformation;
5059
}
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+
}
5197
}

0 commit comments

Comments
 (0)