factorisation
This commit is contained in:
@ -3,19 +3,13 @@
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Validator as AcmeAssert;
|
||||
use Symfony\Component\Security\Core\User\UserInterface;
|
||||
|
||||
class User implements UserInterface
|
||||
class User
|
||||
{
|
||||
/**
|
||||
* @AcmeAssert\ExistingEmail()
|
||||
*/
|
||||
private $email;
|
||||
private string $email;
|
||||
|
||||
private $password;
|
||||
private $datas;
|
||||
private $rememberMe;
|
||||
private $roles;
|
||||
private string $password;
|
||||
private string $rememberMe;
|
||||
|
||||
public function getEmail(): ?string
|
||||
{
|
||||
@ -29,7 +23,6 @@ class User implements UserInterface
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
public function getPassword(): string
|
||||
{
|
||||
return $this->password;
|
||||
@ -42,20 +35,6 @@ class User implements UserInterface
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function addData($data): self
|
||||
{
|
||||
if (!$this->datas->contains($data)) {
|
||||
$this->datas[] = $data;
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getDatas()
|
||||
{
|
||||
return $this->datas;
|
||||
}
|
||||
|
||||
public function getRememberMe(): string
|
||||
{
|
||||
return $this->rememberMe;
|
||||
@ -67,36 +46,4 @@ class User implements UserInterface
|
||||
|
||||
return $this;
|
||||
}
|
||||
public function getUserIdentifier()
|
||||
{
|
||||
return $this->email;
|
||||
}
|
||||
|
||||
public function getRoles(){
|
||||
return $this->roles;
|
||||
}
|
||||
|
||||
public function setRoles(array $roles): self
|
||||
{
|
||||
$this->roles = $roles;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getSalt(){
|
||||
return '';
|
||||
}
|
||||
|
||||
public function eraseCredentials(){
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getUsername(){
|
||||
return $this->email;
|
||||
}
|
||||
|
||||
public function __toString()
|
||||
{
|
||||
return $this->email;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user