|
@@ 335-342 (lines=8) @@
|
| 332 |
|
Location $location, |
| 333 |
|
ContactInformation $contactInformation |
| 334 |
|
) { |
| 335 |
|
if ($this->raLocations->containsWithId($raLocationId)) { |
| 336 |
|
throw new DomainException(sprintf( |
| 337 |
|
'Cannot add RaLocation with RaLocationId "%s" to RaLocations of InstitutionConfiguration "%s":' |
| 338 |
|
. ' it is already present', |
| 339 |
|
$raLocationId, |
| 340 |
|
$this->getAggregateRootId() |
| 341 |
|
)); |
| 342 |
|
} |
| 343 |
|
|
| 344 |
|
$this->apply(new RaLocationAddedEvent( |
| 345 |
|
$this->institutionConfigurationId, |
|
@@ 366-373 (lines=8) @@
|
| 363 |
|
Location $location, |
| 364 |
|
ContactInformation $contactInformation |
| 365 |
|
) { |
| 366 |
|
if (!$this->raLocations->containsWithId($raLocationId)) { |
| 367 |
|
throw new DomainException(sprintf( |
| 368 |
|
'Cannot change RaLocation with RaLocationId "%s" in RaLocations of InstitutionConfiguration "%s":' |
| 369 |
|
. ' it is not present', |
| 370 |
|
$raLocationId, |
| 371 |
|
$this->getAggregateRootId() |
| 372 |
|
)); |
| 373 |
|
} |
| 374 |
|
|
| 375 |
|
$raLocation = $this->raLocations->getById($raLocationId); |
| 376 |
|
|
|
@@ 403-410 (lines=8) @@
|
| 400 |
|
*/ |
| 401 |
|
public function removeRaLocation(RaLocationId $raLocationId) |
| 402 |
|
{ |
| 403 |
|
if (!$this->raLocations->containsWithId($raLocationId)) { |
| 404 |
|
throw new DomainException(sprintf( |
| 405 |
|
'Cannot remove RaLocation with RaLocationId "%s" in RaLocations of InstitutionConfiguration "%s":' |
| 406 |
|
. ' it is not present', |
| 407 |
|
$raLocationId, |
| 408 |
|
$this->getAggregateRootId() |
| 409 |
|
)); |
| 410 |
|
} |
| 411 |
|
|
| 412 |
|
$this->apply(new RaLocationRemovedEvent($this->institutionConfigurationId, $raLocationId)); |
| 413 |
|
} |