| @@ 179-199 (lines=21) @@ | ||
| 176 | * @param Title $title  | 
                                |
| 177 | * @param Language $language  | 
                                |
| 178 | */  | 
                                |
| 179 | public function updateTitle(  | 
                                |
| 180 | Title $title,  | 
                                |
| 181 | Language $language  | 
                                |
| 182 |     ) { | 
                                |
| 183 |         if ($this->isTitleChanged($title, $language)) { | 
                                |
| 184 |             if ($language->getCode() !== $this->mainLanguage->getCode()) { | 
                                |
| 185 | $event = new TitleTranslated(  | 
                                |
| 186 | $this->actorId,  | 
                                |
| 187 | $title,  | 
                                |
| 188 | $language  | 
                                |
| 189 | );  | 
                                |
| 190 |             } else { | 
                                |
| 191 | $event = new TitleUpdated(  | 
                                |
| 192 | $this->actorId,  | 
                                |
| 193 | $title  | 
                                |
| 194 | );  | 
                                |
| 195 | }  | 
                                |
| 196 | ||
| 197 | $this->apply($event);  | 
                                |
| 198 | }  | 
                                |
| 199 | }  | 
                                |
| 200 | ||
| 201 | /**  | 
                                |
| 202 | * @param Address $address  | 
                                |
| @@ 205-225 (lines=21) @@ | ||
| 202 | * @param Address $address  | 
                                |
| 203 | * @param Language $language  | 
                                |
| 204 | */  | 
                                |
| 205 | public function updateAddress(  | 
                                |
| 206 | Address $address,  | 
                                |
| 207 | Language $language  | 
                                |
| 208 |     ) { | 
                                |
| 209 |         if ($this->isAddressChanged($address, $language)) { | 
                                |
| 210 |             if ($language->getCode() !== $this->mainLanguage->getCode()) { | 
                                |
| 211 | $event = new AddressTranslated(  | 
                                |
| 212 | $this->actorId,  | 
                                |
| 213 | $address,  | 
                                |
| 214 | $language  | 
                                |
| 215 | );  | 
                                |
| 216 |             } else { | 
                                |
| 217 | $event = new AddressUpdated(  | 
                                |
| 218 | $this->actorId,  | 
                                |
| 219 | $address  | 
                                |
| 220 | );  | 
                                |
| 221 | }  | 
                                |
| 222 | ||
| 223 | $this->apply($event);  | 
                                |
| 224 | }  | 
                                |
| 225 | }  | 
                                |
| 226 | ||
| 227 | /**  | 
                                |
| 228 | * @param ContactPoint $contactPoint  | 
                                |