src/Entity/Users.php line 13

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\UsersRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
  8. use Symfony\Component\Security\Core\User\UserInterface;
  9. #[ORM\Entity(repositoryClassUsersRepository::class)]
  10. class Users implements UserInterfacePasswordAuthenticatedUserInterface
  11. {
  12.     #[ORM\Id]
  13.     #[ORM\GeneratedValue]
  14.     #[ORM\Column]
  15.     private ?int $id null;
  16.     #[ORM\Column(length180uniquetrue)]
  17.     private ?string $username null;
  18.     #[ORM\Column]
  19.     private array $roles = [];
  20.     /**
  21.      * @var string The hashed password
  22.      */
  23.     #[ORM\Column]
  24.     private ?string $password null;
  25.     #[ORM\Column(length50)]
  26.     private ?string $firstName null;
  27.     #[ORM\Column(length50)]
  28.     private ?string $lastName null;
  29.     #[ORM\Column(length255)]
  30.     private ?string $email null;
  31.     #[ORM\Column]
  32.     private ?bool $valid null;
  33.     #[ORM\Column(length20)]
  34.     private ?string $locale null;
  35.     #[ORM\Column]
  36.     private ?int $maxRequest null;
  37.     #[ORM\ManyToOne(inversedBy'users')]
  38.     #[ORM\JoinColumn(nullablefalse)]
  39.     private ?Profile $profile null;
  40.     #[ORM\ManyToOne(inversedBy'users')]
  41.     #[ORM\JoinColumn(nullablefalse)]
  42.     private ?Zone $zone null;
  43.     #[ORM\Column(length10nullabletrue)]
  44.     private ?string $codeAuth null;
  45.     
  46.     #[ORM\OneToMany(mappedBy'users'targetEntityEvent::class)]
  47.     private $events;
  48.     
  49.     public function __construct()
  50.     {
  51.     }
  52.     
  53.     public function getId(): ?int
  54.     {
  55.         return $this->id;
  56.     }
  57.     public function getUsername(): ?string
  58.     {
  59.         return $this->username;
  60.     }
  61.     public function setUsername(string $username): self
  62.     {
  63.         $this->username $username;
  64.         return $this;
  65.     }
  66.     /**
  67.      * A visual identifier that represents this user.
  68.      *
  69.      * @see UserInterface
  70.      */
  71.     public function getUserIdentifier(): string
  72.     {
  73.         return (string) $this->username;
  74.     }
  75.     /**
  76.      * @see UserInterface
  77.      */
  78.     public function getRoles(): array
  79.     {
  80.         $roles $this->roles;
  81.         // guarantee every user at least has ROLE_USER
  82.         $roles[] = 'ROLE_USER';
  83.         return array_unique($roles);
  84.     }
  85.     public function setRoles(array $roles): self
  86.     {
  87.         $this->roles $roles;
  88.         return $this;
  89.     }
  90.     /**
  91.      * @see PasswordAuthenticatedUserInterface
  92.      */
  93.     public function getPassword(): string
  94.     {
  95.         return $this->password;
  96.     }
  97.     public function setPassword(string $password): self
  98.     {
  99.         $this->password $password;
  100.         return $this;
  101.     }
  102.     /**
  103.      * @see UserInterface
  104.      */
  105.     public function eraseCredentials()
  106.     {
  107.         // If you store any temporary, sensitive data on the user, clear it here
  108.         // $this->plainPassword = null;
  109.     }
  110.     public function getFirstName(): ?string
  111.     {
  112.         return $this->firstName;
  113.     }
  114.     public function setFirstName(string $firstName): self
  115.     {
  116.         $this->firstName $firstName;
  117.         return $this;
  118.     }
  119.     public function getLastName(): ?string
  120.     {
  121.         return $this->lastName;
  122.     }
  123.     public function setLastName(string $lastName): self
  124.     {
  125.         $this->lastName $lastName;
  126.         return $this;
  127.     }
  128.     public function getEmail(): ?string
  129.     {
  130.         return $this->email;
  131.     }
  132.     public function setEmail(string $email): self
  133.     {
  134.         $this->email $email;
  135.         return $this;
  136.     }
  137.     public function isValid(): ?bool
  138.     {
  139.         return $this->valid;
  140.     }
  141.     public function setValid(bool $valid): self
  142.     {
  143.         $this->valid $valid;
  144.         return $this;
  145.     }
  146.     public function getLocale(): ?string
  147.     {
  148.         return $this->locale;
  149.     }
  150.     public function setLocale(string $locale): self
  151.     {
  152.         $this->locale $locale;
  153.         return $this;
  154.     }
  155.     public function getMaxRequest(): ?int
  156.     {
  157.         return $this->maxRequest;
  158.     }
  159.     public function setMaxRequest(int $maxRequest): self
  160.     {
  161.         $this->maxRequest $maxRequest;
  162.         return $this;
  163.     }
  164.     public function getProfile(): ?Profile
  165.     {
  166.         return $this->profile;
  167.     }
  168.     public function setProfile(?Profile $profile): self
  169.     {
  170.         $this->profile $profile;
  171.         return $this;
  172.     }
  173.     public function getZone(): ?Zone
  174.     {
  175.         return $this->zone;
  176.     }
  177.     public function setZone(?Zone $zone): self
  178.     {
  179.         $this->zone $zone;
  180.         return $this;
  181.     }
  182.     public function getCodeAuth(): ?string
  183.     {
  184.         return $this->codeAuth;
  185.     }
  186.     public function setCodeAuth(?string $codeAuth): self
  187.     {
  188.         $this->codeAuth $codeAuth;
  189.         return $this;
  190.     }
  191. }