src/Entity/User.php line 13
<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
use Symfony\Component\Security\Core\User\UserInterface;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity
*/
class User implements UserInterface, PasswordAuthenticatedUserInterface
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=180)
* @Assert\NotBlank()
*/
private $username;
/**
* @ORM\Column(type="json")
* @Assert\NotBlank()
*/
private $roles = [];
/**
* @var string The hashed password
* @ORM\Column(type="string")
* @Assert\NotBlank()
*/
private $password;
/**
* @ORM\Column(type="string", length=255)
* @Assert\NotBlank()
*/
private $lastName;
/**
* @ORM\Column(type="string", length=255)
* @Assert\NotBlank()
*/
private $nickName;
/**
* @ORM\Column(type="string", length=255)
* @Assert\NotBlank()
*/
private $mail;
/**
* @ORM\Column(type="string", length=255,unique=true)
* @Assert\NotBlank()
*/
private $phone;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $society;
/**
* @ORM\Column(type="boolean", nullable=false)
*/
private $isActif;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $isArchived;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $societyFonction;
/**
* @ORM\Column(type="string", length=255)
*/
private $cp;
/**
* @ORM\Column(type="text")
*/
private $adresse;
/**
* @ORM\Column(type="string", length=255)
*/
private $city;
/**
* @ORM\Column(name="date_creation" , type="datetime", length=255)
* @Assert\NotBlank()
*/
private $dateCreation;
public function getId(): ?int
{
return $this->id;
}
/**
* A visual identifier that represents this user.
*
* @see UserInterface
*/
public function getUsername(): string
{
return (string) $this->username;
}
public function setUsername(string $username): self
{
$this->username = $username;
return $this;
}
/**
* @see UserInterface
*/
public function getRoles(): array
{
$roles = $this->roles;
// guarantee every user at least has ROLE_USER
$roles[] = 'ROLE_USER';
return array_unique($roles);
}
public function setRoles(array $roles): self
{
$this->roles = $roles;
return $this;
}
/**
* @see UserInterface
*/
public function getPassword(): string
{
return (string) $this->password;
}
public function setPassword(string $password): self
{
$this->password = $password;
return $this;
}
/**
* @see UserInterface
*/
public function getSalt()
{
// not needed when using the "bcrypt" algorithm in security.yaml
}
/**
* @see UserInterface
*/
public function eraseCredentials()
{
// If you store any temporary, sensitive data on the user, clear it here
// $this->plainPassword = null;
}
public function getLastName(): ?string
{
return $this->lastName;
}
public function setLastName(?string $lastName): self
{
$this->lastName = $lastName;
return $this;
}
public function getNickName(): ?string
{
return $this->nickName;
}
public function setNickName(string $nickName): self
{
$this->nickName = $nickName;
return $this;
}
public function getIsActif(): ?bool
{
return $this->isActif;
}
public function setIsActif(bool $isActif): self
{
$this->isActif = $isActif;
return $this;
}
public function getIsArchived(): ?bool
{
return $this->isArchived;
}
public function setIsArchived(bool $isArchived = false): self
{
$this->isArchived = $isArchived;
return $this;
}
public function getMail(): ?string
{
return $this->mail;
}
public function setMail(string $mail): self
{
$this->mail = $mail;
return $this;
}
public function getPhone(): ?int
{
return $this->phone;
}
public function setPhone(int $phone): self
{
$this->phone = $phone;
return $this;
}
public function getSociety(): ?string
{
return $this->society;
}
public function setSociety(string $society): self
{
$this->society = $society;
return $this;
}
public function getSocietyFonction(): ?string
{
return $this->societyFonction;
}
public function setSocietyFonction(?string $societyFonction): self
{
$this->societyFonction = $societyFonction;
return $this;
}
public function getAdresse(): ?string
{
return $this->adresse;
}
public function setAdresse(string $adresse): self
{
$this->adresse = $adresse;
return $this;
}
public function getCp(): ?string
{
return $this->cp;
}
public function setCp(string $cp): self
{
$this->cp = $cp;
return $this;
}
public function getCity(): ?string
{
return $this->city;
}
public function setCity(string $city): self
{
$this->city = $city;
return $this;
}
public function getUserIdentifier(): string
{
return $this->username;
}
public function getDateCreation(): ?\DateTimeInterface
{
return $this->dateCreation;
}
public function setDateCreation(\DateTimeInterface $dateCreation): self
{
$this->dateCreation = $dateCreation;
return $this;
}
}