|
@@ 200-207 (lines=8) @@
|
| 197 |
|
Location $location, |
| 198 |
|
ContactInformation $contactInformation |
| 199 |
|
) { |
| 200 |
|
if ($this->raLocations->containsWithId($raLocationId)) { |
| 201 |
|
throw new DomainException(sprintf( |
| 202 |
|
'Cannot add RaLocation with RaLocationId "%s" to RaLocations of InstitutionConfiguration "%s":' |
| 203 |
|
. ' it is already present', |
| 204 |
|
$raLocationId, |
| 205 |
|
$this->getAggregateRootId() |
| 206 |
|
)); |
| 207 |
|
} |
| 208 |
|
|
| 209 |
|
$this->apply(new RaLocationAddedEvent( |
| 210 |
|
$this->institutionConfigurationId, |
|
@@ 231-238 (lines=8) @@
|
| 228 |
|
Location $location, |
| 229 |
|
ContactInformation $contactInformation |
| 230 |
|
) { |
| 231 |
|
if (!$this->raLocations->containsWithId($raLocationId)) { |
| 232 |
|
throw new DomainException(sprintf( |
| 233 |
|
'Cannot change RaLocation with RaLocationId "%s" in RaLocations of InstitutionConfiguration "%s":' |
| 234 |
|
. ' it is not present', |
| 235 |
|
$raLocationId, |
| 236 |
|
$this->getAggregateRootId() |
| 237 |
|
)); |
| 238 |
|
} |
| 239 |
|
|
| 240 |
|
$raLocation = $this->raLocations->getById($raLocationId); |
| 241 |
|
|
|
@@ 268-275 (lines=8) @@
|
| 265 |
|
*/ |
| 266 |
|
public function removeRaLocation(RaLocationId $raLocationId) |
| 267 |
|
{ |
| 268 |
|
if (!$this->raLocations->containsWithId($raLocationId)) { |
| 269 |
|
throw new DomainException(sprintf( |
| 270 |
|
'Cannot remove RaLocation with RaLocationId "%s" in RaLocations of InstitutionConfiguration "%s":' |
| 271 |
|
. ' it is not present', |
| 272 |
|
$raLocationId, |
| 273 |
|
$this->getAggregateRootId() |
| 274 |
|
)); |
| 275 |
|
} |
| 276 |
|
|
| 277 |
|
$this->apply(new RaLocationRemovedEvent($this->institutionConfigurationId, $raLocationId)); |
| 278 |
|
} |