-
-
Save anonymous/e88caba1a22a3885f267 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Opp\MyBestBundle\Entity; | |
use Doctrine\ORM\Mapping as ORM; | |
use Symfony\Component\Security\Core\User\UserInterface; | |
use Symfony\Component\Security\Core\User\EquatableInterface; | |
/** | |
* Opp\MyBestBundle\Entity\User | |
* @ORM\Table(name="user") | |
* @ORM\Entity(repositoryClass="Opp\MyBestBundle\Entity\UserRepository") | |
*/ | |
class User implements UserInterface, \Serializable, EquatableInterface | |
{ | |
/* ATTRIBUTS */ | |
/** | |
* @ORM\Id | |
* @ORM\Column(type="integer") | |
* @ORM\GeneratedValue(strategy="AUTO") | |
*/ | |
protected $id; | |
/** | |
* @ORM\Column(type="string", length=255) | |
*/ | |
protected $prenom; | |
/** | |
* @ORM\Column(type="string", length=255, unique=true) | |
*/ | |
protected $nom; | |
/** | |
* @ORM\Column(type="string", length=255) | |
*/ | |
protected $username; | |
/** | |
* @ORM\Column(type="string", length=255) | |
*/ | |
protected $salt; | |
/** | |
* @ORM\Column(type="string", length=255) | |
*/ | |
protected $password; | |
/** | |
* @ORM\Column(name="roles", type="array") | |
*/ | |
protected $roles; | |
/* METHODES */ | |
public function __construct() | |
{ | |
$this->roles = array(); | |
} | |
public function eraseCredentials() | |
{ | |
} | |
public function serialize() | |
{ | |
return serialize(array($this->id,)); | |
} | |
public function unserialize($serialized) | |
{ | |
list($this->id,) = unserialize($serialized); | |
} | |
public function isEqualTo(UserInterface $user) | |
{ | |
return $this->username === $user->getUsername(); | |
} | |
/* GETTERS & SETTERS */ | |
public function getId() | |
{ | |
return $this->id; | |
} | |
public function getPrenom() | |
{ | |
return $this->prenom; | |
} | |
public function setPrenom($prenom) | |
{ | |
$this->prenom = $prenom; | |
return $this; | |
} | |
public function getNom() | |
{ | |
return $this->nom; | |
} | |
public function setNom($nom) | |
{ | |
$this->nom = $nom; | |
return $this; | |
} | |
public function getUsername() | |
{ | |
return $this->username; | |
} | |
public function setUsername($username) | |
{ | |
$this->username = $username; | |
return $this; | |
} | |
public function getSalt() | |
{ | |
return $this->salt; | |
} | |
public function setSalt($salt) | |
{ | |
$this->salt = $salt; | |
return $this; | |
} | |
public function getPassword() | |
{ | |
return $this->password; | |
} | |
public function setPassword($password) | |
{ | |
$this->password = $password; | |
return $this; | |
} | |
public function getRoles() | |
{ | |
return $this->roles; | |
} | |
public function setRoles($roles) | |
{ | |
$this->roles = $roles; | |
return $this; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment