feat: import users` real names from bpn API
This commit is contained in:
1 parent
bf69fcceff
commit
77de1643f0
11 files changed
+96
-7
No files matched your search
@@ -27,6 +27,12 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
|
||||
#[ORM\Column(type: 'integer', nullable: true)]
|
||||
private ?int $addressId = null;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 100, nullable: true)]
|
||||
private ?string $firstName = null;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 100, nullable: true)]
|
||||
private ?string $lastName = null;
|
||||
|
||||
/**
|
||||
* @var array<string>
|
||||
*/
|
||||
@@ -91,6 +97,46 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getFirstName(): ?string
|
||||
{
|
||||
return $this->firstName;
|
||||
}
|
||||
|
||||
public function setFirstName(?string $firstName): static
|
||||
{
|
||||
$this->firstName = $firstName;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getLastName(): ?string
|
||||
{
|
||||
return $this->lastName;
|
||||
}
|
||||
|
||||
public function setLastName(?string $lastName): static
|
||||
{
|
||||
$this->lastName = $lastName;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getFullName(): ?string
|
||||
{
|
||||
$fullName = trim(sprintf('%s %s', $this->firstName, $this->lastName));
|
||||
|
||||
return '' !== $fullName ? $fullName : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* The name to identify this account by in the UI. BusPro only fills the name in on login, so
|
||||
* accounts that have not signed in since the columns were added fall back to their e-mail.
|
||||
*/
|
||||
public function getDisplayName(): string
|
||||
{
|
||||
return $this->getFullName() ?? (string) $this->email;
|
||||
}
|
||||
|
||||
public function getPassword(): ?string
|
||||
{
|
||||
return base64_decode($this->password);
|
||||
|
||||
Reference in new issue
Block a user