feat: add method to generate users' initials
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user