hydra-sql/src/Entity/User.php

102 lines
1.7 KiB
PHP

<?php
namespace App\Entity;
use App\Validator as AcmeAssert;
use Symfony\Component\Security\Core\User\UserInterface;
class User implements UserInterface
{
/**
* @AcmeAssert\ExistingEmail()
*/
private $email;
private $password;
private $datas;
private $rememberMe;
private $roles;
public function getEmail(): ?string
{
return $this->email;
}
public function setEmail(string $email): self
{
$this->email = $email;
return $this;
}
public function getPassword(): string
{
return $this->password;
}
public function setPassword(string $password): self
{
$this->password = $password;
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;
}
public function setRememberMe(bool $rememberMe): self
{
$this->rememberMe = $rememberMe;
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;
}
}