src/Entity/User.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use FOS\UserBundle\Model\User as BaseUser;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Component\Security\Core\User\UserInterface;
  8. use Symfony\Component\Security\Core\Exception\UnsupportedUserException;
  9. use Symfony\Component\Security\Core\Exception\UsernameNotFoundException;
  10. /**
  11.  * @ORM\Entity(repositoryClass=AdminRepository::class)
  12.  */
  13. class User implements UserInterface
  14. {
  15.     /**
  16.      * @ORM\Id()
  17.      * @ORM\GeneratedValue()
  18.      * @ORM\Column(type="integer")
  19.      */
  20.     private $id;
  21.     /**
  22.      * @ORM\Column(type="string", length=255, nullable=true)
  23.      */
  24.     private $username;
  25.     /**
  26.      * @ORM\Column(type="string", length=255, nullable=true)
  27.      */
  28.     private $email;
  29.     /**
  30.      * @ORM\Column(type="string", length=255, nullable=true)
  31.      */
  32.     private $password;
  33.     public function __construct()
  34.     {
  35.         $this->helps = new ArrayCollection();
  36.     }
  37.     public function getId(): ?int
  38.     {
  39.         return $this->id;
  40.     }
  41.     /**
  42.      * @return string|null
  43.      */
  44.     public function getUsername(): ?string
  45.     {
  46.         return $this->username;
  47.     }
  48.     /**
  49.      * @param string|null $username
  50.      * @return $this
  51.      */
  52.     public function setUsername(?string $username): self
  53.     {
  54.         $this->username $username;
  55.         return $this;
  56.     }
  57.     /**
  58.      * @return string|null
  59.      */
  60.     public function getEmail(): ?string
  61.     {
  62.         return $this->email;
  63.     }
  64.     /**
  65.      * @param string|null $email
  66.      * @return $this
  67.      */
  68.     public function setEmail(?string $email): self
  69.     {
  70.         $this->email $email;
  71.         return $this;
  72.     }
  73.     /**
  74.      * @return string|null
  75.      */
  76.     public function getPassword(): ?string
  77.     {
  78.         return $this->password;
  79.     }
  80.     /**
  81.      * @param string|null $password
  82.      * @return $this
  83.      */
  84.     public function setPassword(?string $password): self
  85.     {
  86.         $this->password $password;
  87.         return $this;
  88.     }
  89.     /**
  90.      * @return bool
  91.      */
  92.     public function isEnabled(): bool
  93.     {
  94.         return $this->enabled;
  95.     }
  96.     /**
  97.      * @param bool $enabled
  98.      * @return User
  99.      */
  100.     public function setEnabled(bool $enabled): User
  101.     {
  102.         $this->enabled $enabled;
  103.         return $this;
  104.     }
  105.     /**
  106.      * @return string
  107.      */
  108.     public function getRole(): ?string
  109.     {
  110.         return $this->role;
  111.     }
  112.     /**
  113.      * {@inheritdoc}
  114.      */
  115.     public function getRoles(): array
  116.     {
  117.         return [$this->role];
  118.     }
  119.     /**
  120.      * @param string $role
  121.      */
  122.     public function setRole(string $role): void
  123.     {
  124.         $this->role $role;
  125.     }
  126.     /**
  127.      * @return bool
  128.      */
  129.     public function isHasValidatedCGU(): bool
  130.     {
  131.         return $this->hasValidatedCGU;
  132.     }
  133.     /**
  134.      * @param bool $hasValidatedCGU
  135.      */
  136.     public function setHasValidatedCGU(bool $hasValidatedCGU): void
  137.     {
  138.         $this->hasValidatedCGU $hasValidatedCGU;
  139.     }
  140.     /**
  141.      * @return string
  142.      */
  143.     public function getReference(): string
  144.     {
  145.         return $this->reference;
  146.     }
  147.     /**
  148.      * @param string $reference
  149.      */
  150.     public function setReference(string $reference): void
  151.     {
  152.         $this->reference $reference;
  153.     }
  154.     /**
  155.      * @param \DateTime|null $passwordResetDate
  156.      */
  157.     public function setPasswordResetDate(?\DateTime $passwordResetDate): void
  158.     {
  159.         $this->passwordResetDate $passwordResetDate;
  160.     }
  161.     /**
  162.      * @return \DateTime|null
  163.      */
  164.     public function getPasswordResetDate(): ?\DateTime
  165.     {
  166.         return $this->passwordResetDate;
  167.     }
  168.     /**
  169.      * @param string $passwordReset
  170.      */
  171.     public function setPasswordReset($passwordReset): void
  172.     {
  173.         $this->passwordReset $passwordReset;
  174.     }
  175.     /**
  176.      * @return string|null
  177.      */
  178.     public function getPasswordReset(): ?string
  179.     {
  180.         return $this->passwordReset;
  181.     }
  182.     /**
  183.      * @param \DateTime|null $updated
  184.      */
  185.     public function setUpdated(?\DateTime $updated): void
  186.     {
  187.         $this->updated $updated;
  188.     }
  189.     /**
  190.      * @return \DateTime|null
  191.      */
  192.     public function getUpdated(): ?\DateTime
  193.     {
  194.         return $this->updated;
  195.     }
  196.     /**
  197.      * @param \DateTime|null $creadted
  198.      */
  199.     public function setCreated(?\DateTime $creadted): void
  200.     {
  201.         $this->created $creadted;
  202.     }
  203.     /**
  204.      * @return \DateTime|null
  205.      */
  206.     public function getCreated(): ?\DateTime
  207.     {
  208.         return $this->created;
  209.     }
  210.     /**
  211.      * @return \DateTime|null
  212.      */
  213.     public function getDeleted(): ?\DateTime
  214.     {
  215.         return $this->deleted;
  216.     }
  217.     /**
  218.      * @param \DateTime $deleted
  219.      */
  220.     public function setDeleted(\DateTime $deleted): void
  221.     {
  222.         $this->deleted $deleted;
  223.     }
  224.     /**
  225.      * @return string|null
  226.      */
  227.     public function getSalt()
  228.     {
  229.         return null;
  230.     }
  231.     /**
  232.      * Loads the user for the given username.
  233.      *
  234.      * @param string $username The username
  235.      *
  236.      * @return UserInterface
  237.      *
  238.      * @throws UsernameNotFoundException if the user is not found
  239.      */
  240.     public function loadUserByUsername($username)
  241.     {
  242.         // TODO: Implement loadUserByUsername() method.
  243.     }
  244.     /**
  245.      * Refreshes the user for the account interface.
  246.      *
  247.      * @param UserInterface $user
  248.      *
  249.      * @return UserInterface
  250.      *
  251.      * @throws UnsupportedUserException if the account is not supported
  252.      */
  253.     public function refreshUser(UserInterface $user)
  254.     {
  255.         // TODO: Implement refreshUser() method.
  256.     }
  257.     public function eraseCredentials()
  258.     {
  259.     }
  260. }