feat: add method to generate users' initials
This commit is contained in:
1 parent
243d1b538c
commit
5a22644b1a
1 file changed
+7
@@ -134,6 +134,13 @@ class User implements UserInterface, TimestampableEntityInterface
|
|||||||
return sprintf('%s %s', $this->getFirstName(), $this->getLastName());
|
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
|
public function getEmail(): ?string
|
||||||
{
|
{
|
||||||
return $this->email;
|
return $this->email;
|
||||||
|
|||||||
Reference in new issue
Block a user