<?php
namespace App\Entity\Main\Administration;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Security\Core\User\UserInterface;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
/**
* User
*
* @ORM\Table(name="users")
* @ORM\Entity(repositoryClass="App\Repository\Administration\UserRepository")
*/
class User implements UserInterface, \Serializable
{
/**
* @ORM\Column(type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ORM\Column(type="string", length=25, unique=true)
*/
private $username;
/**
* @ORM\Column(type="string", length=64)
*/
private $password;
/**
* @ORM\Column(type="string", length=254, unique=true)
*/
private $email;
/**
* @ORM\Column(name="is_active", type="boolean")
*/
private $isActive;
/**
* @Assert\NotBlank()
* @Assert\Length(max=4096)
*/
private $plainPassword;
/**
* @ORM\Column(type="string", length=60, nullable=true)
*/
private $business_name;
/**
* @ORM\Column(type="string", length=60)
*/
private $firstname;
/**
* @ORM\Column(type="string", length=60, nullable=true)
*/
private $lastname;
/**
* @ORM\Column(type="string", length=60, nullable=true)
*/
private $Job;
/**
* @ORM\Column(type="string", length=60)
*/
private $rules;
/**
* @ORM\Column(type="string", length=60)
*/
private $locale;
/**
* @ORM\Column(type="boolean", nullable="true")
*/
private $en_attente;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $created_at;
/**
* @ORM\Column(name="client_id", type="uuid", nullable=true)
*/
private $client_id;
/**
* @ORM\Column(type="date", nullable=true)
*/
private $updated_at;
public function getPlainPassword()
{
return $this->plainPassword;
}
public function setPlainPassword($password)
{
$this->plainPassword = $password;
}
public function __construct()
{
$this->isActive = true;
// may not be needed, see section on salt below
// $this->salt = md5(uniqid('', true));
}
public function getUsername()
{
return $this->username;
}
public function getSalt()
{
return null;
}
public function getPassword()
{
return $this->password;
}
public function getRoles()
{
return array($this->rules);
}
public function eraseCredentials()
{
}
/** @see \Serializable::serialize() */
public function serialize()
{
return serialize(array(
$this->id,
$this->username,
$this->password,
));
}
/** @see \Serializable::unserialize() */
public function unserialize($serialized)
{
list(
$this->id,
$this->username,
$this->password,
) = unserialize($serialized, ['allowed_classes' => false]);
}
public function getId(): ?int
{
return $this->id;
}
public function setUsername(string $username): self
{
$this->username = $username;
return $this;
}
public function setPassword(string $password): self
{
$this->password = $password;
return $this;
}
public function getEmail(): ?string
{
return $this->email;
}
public function setEmail(string $email): self
{
$this->email = $email;
return $this;
}
public function getIsActive(): ?bool
{
return $this->isActive;
}
public function setIsActive(bool $isActive): self
{
$this->isActive = $isActive;
return $this;
}
public function getBusinessName(): ?string
{
return $this->business_name;
}
public function setBusinessName(?string $business_name): self
{
$this->business_name = $business_name;
return $this;
}
public function getFirstname(): ?string
{
return $this->firstname;
}
public function setFirstname(string $firstname): self
{
$this->firstname = $firstname;
return $this;
}
public function getLastname(): ?string
{
return $this->lastname;
}
public function setLastname(?string $lastname): self
{
$this->lastname = $lastname;
return $this;
}
public function getJob(): ?string
{
return $this->Job;
}
public function setJob(?string $Job): self
{
$this->Job = $Job;
return $this;
}
public function getRules(): ?string
{
return $this->rules;
}
public function setRules(string $rules): self
{
$this->rules = $rules;
return $this;
}
public function getLocale(): ?string
{
return $this->locale;
}
public function setLocale(string $locale): self
{
$this->locale = $locale;
return $this;
}
public function getEn_attente(): ?bool
{
return $this->en_attente;
}
public function setEn_attente(bool $en_attente): self
{
$this->en_attente = $en_attente;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->created_at;
}
public function setCreatedAt(?\DateTimeInterface $created_at): self
{
$this->created_at = $created_at;
return $this;
}
public function getClientId()
{
return $this->client_id;
}
public function setClientId($client_id): self
{
$this->client_id = $client_id;
return $this;
}
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updated_at;
}
public function setUpdatedAt(?\DateTimeInterface $updated_at): self
{
$this->updated_at = $updated_at;
return $this;
}
}