diff --git a/src/Entity/User.php b/src/Entity/User.php index 1cc207e..dce5872 100644 --- a/src/Entity/User.php +++ b/src/Entity/User.php @@ -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;