Feature: [person][creation] Add center field to OnTheFly/Person

This commit is contained in:
2022-11-22 22:28:18 +01:00
parent b06a76784a
commit 1f58acd871
5 changed files with 71 additions and 8 deletions

View File

@@ -1567,7 +1567,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
*
* @return $this
*/
public function setCenter(Center $center): self
public function setCenter(?Center $center): self
{
$modification = new DateTimeImmutable('now');
@@ -1577,7 +1577,11 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
}
}
$this->centerHistory[] = $new = new PersonCenterHistory($this, $center, $modification);
if (null === $center) {
return $this;
}
$this->centerHistory[] = new PersonCenterHistory($this, $center, $modification);
return $this;
}