src/Entity/Main/Administration/User.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Main\Administration;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Symfony\Component\Security\Core\User\UserInterface;
  5. use Symfony\Component\Validator\Constraints as Assert;
  6. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  7. /**
  8.  * User
  9.  * 
  10.  * @ORM\Table(name="users")
  11.  * @ORM\Entity(repositoryClass="App\Repository\Administration\UserRepository")
  12.  */
  13. class User implements UserInterface\Serializable
  14. {
  15.     /**
  16.      * @ORM\Column(type="integer")
  17.      * @ORM\Id
  18.      * @ORM\GeneratedValue(strategy="AUTO")
  19.      */
  20.     private $id;
  21.     /**
  22.      * @ORM\Column(type="string", length=25, unique=true)
  23.      */
  24.     private $username;
  25.     /**
  26.      * @ORM\Column(type="string", length=64)
  27.      */
  28.     private $password;
  29.     /**
  30.      * @ORM\Column(type="string", length=254, unique=true)
  31.      */
  32.     private $email;
  33.     /**
  34.      * @ORM\Column(name="is_active", type="boolean")
  35.      */
  36.     private $isActive;
  37.     /**
  38.      * @Assert\NotBlank()
  39.      * @Assert\Length(max=4096)
  40.      */
  41.     private $plainPassword;
  42.     /**
  43.      * @ORM\Column(type="string", length=60, nullable=true)
  44.      */
  45.     private $business_name;
  46.     /**
  47.      * @ORM\Column(type="string", length=60)
  48.      */
  49.     private $firstname;
  50.     /**
  51.      * @ORM\Column(type="string", length=60, nullable=true)
  52.      */
  53.     private $lastname;
  54.     /**
  55.      * @ORM\Column(type="string", length=60, nullable=true)
  56.      */
  57.     private $Job;
  58.     /**
  59.      * @ORM\Column(type="string", length=60)
  60.      */
  61.     private $rules;
  62.     /**
  63.      * @ORM\Column(type="string", length=60)
  64.      */
  65.     private $locale;
  66.     /**
  67.      * @ORM\Column(type="boolean", nullable="true")
  68.      */
  69.     private $en_attente;
  70.     /**
  71.      * @ORM\Column(type="datetime", nullable=true)
  72.      */
  73.     private $created_at;
  74.     /**
  75.      * @ORM\Column(name="client_id", type="uuid", nullable=true)
  76.      */
  77.     private $client_id;
  78.     /**
  79.      * @ORM\Column(type="date", nullable=true)
  80.      */
  81.     private $updated_at;
  82.     public function getPlainPassword()
  83.     {
  84.         return $this->plainPassword;
  85.     }
  86.     public function setPlainPassword($password)
  87.     {
  88.         $this->plainPassword $password;
  89.     }
  90.     public function __construct()
  91.     {
  92.         $this->isActive true;
  93.         // may not be needed, see section on salt below
  94.         // $this->salt = md5(uniqid('', true));
  95.     }
  96.     public function getUsername()
  97.     {
  98.         return $this->username;
  99.     }
  100.     public function getSalt()
  101.     {
  102.         return null;
  103.     }
  104.     public function getPassword()
  105.     {
  106.         return $this->password;
  107.     }
  108.     public function getRoles()
  109.     {
  110.         return array($this->rules);
  111.     }
  112.     public function eraseCredentials()
  113.     {
  114.     }
  115.     /** @see \Serializable::serialize() */
  116.     public function serialize()
  117.     {
  118.         return serialize(array(
  119.             $this->id,
  120.             $this->username,
  121.             $this->password,
  122.         ));
  123.     }
  124.     /** @see \Serializable::unserialize() */
  125.     public function unserialize($serialized)
  126.     {
  127.         list(
  128.             $this->id,
  129.             $this->username,
  130.             $this->password,
  131.         ) = unserialize($serialized, ['allowed_classes' => false]);
  132.     }
  133.     public function getId(): ?int
  134.     {
  135.         return $this->id;
  136.     }
  137.     public function setUsername(string $username): self
  138.     {
  139.         $this->username $username;
  140.         return $this;
  141.     }
  142.     public function setPassword(string $password): self
  143.     {
  144.         $this->password $password;
  145.         return $this;
  146.     }
  147.     public function getEmail(): ?string
  148.     {
  149.         return $this->email;
  150.     }
  151.     public function setEmail(string $email): self
  152.     {
  153.         $this->email $email;
  154.         return $this;
  155.     }
  156.     public function getIsActive(): ?bool
  157.     {
  158.         return $this->isActive;
  159.     }
  160.     public function setIsActive(bool $isActive): self
  161.     {
  162.         $this->isActive $isActive;
  163.         return $this;
  164.     }
  165.     public function getBusinessName(): ?string
  166.     {
  167.         return $this->business_name;
  168.     }
  169.     public function setBusinessName(?string $business_name): self
  170.     {
  171.         $this->business_name $business_name;
  172.         return $this;
  173.     }
  174.     public function getFirstname(): ?string
  175.     {
  176.         return $this->firstname;
  177.     }
  178.     public function setFirstname(string $firstname): self
  179.     {
  180.         $this->firstname $firstname;
  181.         return $this;
  182.     }
  183.     public function getLastname(): ?string
  184.     {
  185.         return $this->lastname;
  186.     }
  187.     public function setLastname(?string $lastname): self
  188.     {
  189.         $this->lastname $lastname;
  190.         return $this;
  191.     }
  192.     public function getJob(): ?string
  193.     {
  194.         return $this->Job;
  195.     }
  196.     public function setJob(?string $Job): self
  197.     {
  198.         $this->Job $Job;
  199.         return $this;
  200.     }
  201.     public function getRules(): ?string
  202.     {
  203.         return $this->rules;
  204.     }
  205.     public function setRules(string $rules): self
  206.     {
  207.         $this->rules $rules;
  208.         return $this;
  209.     }
  210.     public function getLocale(): ?string
  211.     {
  212.         return $this->locale;
  213.     }
  214.     public function setLocale(string $locale): self
  215.     {
  216.         $this->locale $locale;
  217.         return $this;
  218.     }
  219.     public function getEn_attente(): ?bool
  220.     {
  221.         return $this->en_attente;
  222.     }
  223.     public function setEn_attente(bool $en_attente): self
  224.     {
  225.         $this->en_attente $en_attente;
  226.         return $this;
  227.     }
  228.     public function getCreatedAt(): ?\DateTimeInterface
  229.     {
  230.         return $this->created_at;
  231.     }
  232.     public function setCreatedAt(?\DateTimeInterface $created_at): self
  233.     {
  234.         $this->created_at $created_at;
  235.         return $this;
  236.     }
  237.     public function getClientId()
  238.     {
  239.         return $this->client_id;
  240.     }
  241.     public function setClientId($client_id): self
  242.     {
  243.         $this->client_id $client_id;
  244.         return $this;
  245.     }
  246.     public function getUpdatedAt(): ?\DateTimeInterface
  247.     {
  248.         return $this->updated_at;
  249.     }
  250.     public function setUpdatedAt(?\DateTimeInterface $updated_at): self
  251.     {
  252.         $this->updated_at $updated_at;
  253.         return $this;
  254.     }
  255. }