feat: add method to generate users' initials

This commit is contained in:
Björn Fromme
2025-02-06 11:25:18 +01:00
parent 243d1b538c
commit 5a22644b1a
+7
View File
@@ -134,6 +134,13 @@ class User implements UserInterface, TimestampableEntityInterface
return sprintf('%s %s', $this->getFirstName(), $this->getLastName());
}
public function getInitials(): string
{
$token = substr($this->getFirstName(), 0, 1).substr($this->getLastName(), 0, 2);
return strtoupper($token);
}
public function getEmail(): ?string
{
return $this->email;