59 lines
1.0 KiB
PHP
59 lines
1.0 KiB
PHP
<?php
|
|
|
|
namespace App\Entity;
|
|
|
|
use Symfony\Component\Security\Core\User\UserInterface;
|
|
|
|
class User implements UserInterface
|
|
{
|
|
private array $attributes = [];
|
|
private string $login;
|
|
private string $password;
|
|
|
|
public function __construct($login, $password, $attributes)
|
|
{
|
|
$this->password = $password;
|
|
$this->login = $login;
|
|
$this->attributes = $attributes;
|
|
}
|
|
|
|
public function getLogin(): ?string
|
|
{
|
|
return $this->login;
|
|
}
|
|
|
|
public function getPassword(): string
|
|
{
|
|
return $this->password;
|
|
}
|
|
|
|
public function getAttributes(): array
|
|
{
|
|
return $this->attributes;
|
|
}
|
|
|
|
public function getRoles(): array
|
|
{
|
|
return ['ROLE_USER'];
|
|
}
|
|
|
|
public function getSalt(): ?string
|
|
{
|
|
return null;
|
|
}
|
|
|
|
public function eraseCredentials()
|
|
{
|
|
}
|
|
|
|
public function getUsername(): string
|
|
{
|
|
return $this->login;
|
|
}
|
|
|
|
public function getUserIdentifier(): string
|
|
{
|
|
return $this->login;
|
|
}
|
|
}
|