@@ 376-383 (lines=8) @@ | ||
373 | Location $location, |
|
374 | ContactInformation $contactInformation |
|
375 | ) { |
|
376 | if ($this->raLocations->containsWithId($raLocationId)) { |
|
377 | throw new DomainException(sprintf( |
|
378 | 'Cannot add RaLocation with RaLocationId "%s" to RaLocations of InstitutionConfiguration "%s":' |
|
379 | . ' it is already present', |
|
380 | $raLocationId, |
|
381 | $this->getAggregateRootId() |
|
382 | )); |
|
383 | } |
|
384 | ||
385 | $this->apply(new RaLocationAddedEvent( |
|
386 | $this->institutionConfigurationId, |
|
@@ 407-414 (lines=8) @@ | ||
404 | Location $location, |
|
405 | ContactInformation $contactInformation |
|
406 | ) { |
|
407 | if (!$this->raLocations->containsWithId($raLocationId)) { |
|
408 | throw new DomainException(sprintf( |
|
409 | 'Cannot change RaLocation with RaLocationId "%s" in RaLocations of InstitutionConfiguration "%s":' |
|
410 | . ' it is not present', |
|
411 | $raLocationId, |
|
412 | $this->getAggregateRootId() |
|
413 | )); |
|
414 | } |
|
415 | ||
416 | $raLocation = $this->raLocations->getById($raLocationId); |
|
417 | ||
@@ 444-451 (lines=8) @@ | ||
441 | */ |
|
442 | public function removeRaLocation(RaLocationId $raLocationId) |
|
443 | { |
|
444 | if (!$this->raLocations->containsWithId($raLocationId)) { |
|
445 | throw new DomainException(sprintf( |
|
446 | 'Cannot remove RaLocation with RaLocationId "%s" in RaLocations of InstitutionConfiguration "%s":' |
|
447 | . ' it is not present', |
|
448 | $raLocationId, |
|
449 | $this->getAggregateRootId() |
|
450 | )); |
|
451 | } |
|
452 | ||
453 | $this->apply(new RaLocationRemovedEvent($this->institutionConfigurationId, $raLocationId)); |
|
454 | } |