hydra-sql/src/Entity/User.php

66 lines
1.2 KiB
PHP
Raw Normal View History

2022-05-03 08:54:45 +02:00
<?php
namespace App\Entity;
use Symfony\Component\Security\Core\User\UserInterface;
2022-05-03 08:54:45 +02:00
class User implements UserInterface
2022-05-03 08:54:45 +02:00
{
protected array $attributes = [];
private string $login;
2022-05-03 15:09:42 +02:00
private string $password;
private bool $rememberMe;
2022-05-03 08:54:45 +02:00
public function __construct($login, $password, $attributes, $rememberMe = false)
2022-05-03 08:54:45 +02:00
{
$this->password = $password;
$this->login = $login;
$this->attributes = $attributes;
$this->rememberMe = $rememberMe;
2022-05-03 08:54:45 +02:00
}
public function getLogin(): ?string
2022-05-03 08:54:45 +02:00
{
return $this->login;
2022-05-03 08:54:45 +02:00
}
public function getPassword(): string
{
return $this->password;
}
public function getAttributes(): array
2022-05-03 08:54:45 +02:00
{
return $this->attributes;
2022-05-03 08:54:45 +02:00
}
public function getRememberMe(): bool
2022-05-03 08:54:45 +02:00
{
return $this->rememberMe;
}
public function getRoles(): array
2022-05-03 08:54:45 +02:00
{
return ['ROLE_USER'];
}
public function getSalt(): ?string
{
return null;
}
public function eraseCredentials()
{
}
2022-05-03 08:54:45 +02:00
public function getUsername(): string
{
return $this->login;
}
public function getUserIdentifier(): string
{
return $this->login;
2022-05-03 08:54:45 +02:00
}
}