@@ 121-128 (lines=8) @@ | ||
118 | Location $location, |
|
119 | ContactInformation $contactInformation |
|
120 | ) { |
|
121 | if (!$this->raLocations->containsWithId($raLocationId)) { |
|
122 | throw new DomainException(sprintf( |
|
123 | 'Cannot change RaLocation with RaLocationId "%s" in RaLocations of InstitutionConfiguration "%s":' |
|
124 | . 'it is not present', |
|
125 | $raLocationId, |
|
126 | $this->getAggregateRootId() |
|
127 | )); |
|
128 | } |
|
129 | ||
130 | $raLocation = $this->raLocations->getById($raLocationId); |
|
131 | ||
@@ 158-165 (lines=8) @@ | ||
155 | */ |
|
156 | public function removeRaLocation(RaLocationId $raLocationId) |
|
157 | { |
|
158 | if (!$this->raLocations->containsWithId($raLocationId)) { |
|
159 | throw new DomainException(sprintf( |
|
160 | 'Cannot remove RaLocation with RaLocationId "%s" in RaLocations of InstitutionConfiguration "%s":' |
|
161 | . 'it is not present', |
|
162 | $raLocationId, |
|
163 | $this->getAggregateRootId() |
|
164 | )); |
|
165 | } |
|
166 | ||
167 | $this->apply(new RaLocationRemovedEvent($this->institutionConfigurationId, $raLocationId)); |
|
168 | } |
|
@@ 91-98 (lines=8) @@ | ||
88 | Location $location, |
|
89 | ContactInformation $contactInformation |
|
90 | ) { |
|
91 | if ($this->raLocations->containsWithId($raLocationId)) { |
|
92 | throw new DomainException(sprintf( |
|
93 | 'Cannot add RaLocation with RaLocationId "%s" to RaLocations of InstitutionConfiguration "%s":' |
|
94 | . 'it is already present', |
|
95 | $raLocationId, |
|
96 | $this->getAggregateRootId() |
|
97 | )); |
|
98 | } |
|
99 | ||
100 | $this->apply(new RaLocationAddedEvent( |
|
101 | $this->institutionConfigurationId, |