entity listener added to person to capitalize names

This commit is contained in:
Julie Lenaerts 2021-10-05 13:57:04 +02:00
parent af4cf55046
commit 7d8f380050

View File

@ -1775,4 +1775,18 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
return $this;
}
/**
* @ORM\PrePersist
*/
public function nameToCaps(): void
{
$firstNameCaps = ucfirst(strtolower($this->firstName));
$this->setFirstName($firstNameCaps);
$lastNameCaps = strtoupper($this->lastName);
$this->setLastName($lastNameCaps);
}
}