src/Entity/Administration.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\AdministrationRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
  6. use Symfony\Component\Security\Core\User\UserInterface;
  7. #[ORM\Entity(repositoryClassAdministrationRepository::class)]
  8. class Administration implements UserInterfacePasswordAuthenticatedUserInterface
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column]
  13.     private ?int $id null;
  14.     #[ORM\Column(length180uniquetrue)]
  15.     private ?string $email null;
  16.     #[ORM\Column]
  17.     private array $roles = [];
  18.     /**
  19.      * @var string The hashed password
  20.      */
  21.     #[ORM\Column]
  22.     private ?string $password null;
  23.     #[ORM\Column(length255)]
  24.     private ?string $firstName null;
  25.     #[ORM\Column(length255)]
  26.     private ?string $lastName null;
  27.     #[ORM\Column(nullabletrue)]
  28.     private ?\DateTimeImmutable $activatedAt null;
  29.     #[ORM\Column]
  30.     private ?bool $activated null;
  31.     public function getId(): ?int
  32.     {
  33.         return $this->id;
  34.     }
  35.     public function getEmail(): ?string
  36.     {
  37.         return $this->email;
  38.     }
  39.     public function setEmail(string $email): static
  40.     {
  41.         $this->email $email;
  42.         return $this;
  43.     }
  44.     /**
  45.      * A visual identifier that represents this user.
  46.      *
  47.      * @see UserInterface
  48.      */
  49.     public function getUserIdentifier(): string
  50.     {
  51.         return (string) $this->email;
  52.     }
  53.     /**
  54.      * @see UserInterface
  55.      */
  56.     public function getRoles(): array
  57.     {
  58.         $roles $this->roles;
  59.         // guarantee every user at least has ROLE_USER
  60.         $roles[] = 'ROLE_USER';
  61.         return array_unique($roles);
  62.     }
  63.     public function setRoles(array $roles): static
  64.     {
  65.         $this->roles $roles;
  66.         return $this;
  67.     }
  68.     /**
  69.      * @see PasswordAuthenticatedUserInterface
  70.      */
  71.     public function getPassword(): string
  72.     {
  73.         return $this->password;
  74.     }
  75.     public function setPassword(string $password): static
  76.     {
  77.         $this->password $password;
  78.         return $this;
  79.     }
  80.     /**
  81.      * @see UserInterface
  82.      */
  83.     public function eraseCredentials(): void
  84.     {
  85.         // If you store any temporary, sensitive data on the user, clear it here
  86.         // $this->plainPassword = null;
  87.     }
  88.     public function getFirstName(): ?string
  89.     {
  90.         return $this->firstName;
  91.     }
  92.     public function setFirstName(string $firstName): static
  93.     {
  94.         $this->firstName $firstName;
  95.         return $this;
  96.     }
  97.     public function getLastName(): ?string
  98.     {
  99.         return $this->lastName;
  100.     }
  101.     public function setLastName(string $lastName): static
  102.     {
  103.         $this->lastName $lastName;
  104.         return $this;
  105.     }
  106.     public function getActivatedAt(): ?\DateTimeImmutable
  107.     {
  108.         return $this->activatedAt;
  109.     }
  110.     public function setActivatedAt(?\DateTimeImmutable $activatedAt): static
  111.     {
  112.         $this->activatedAt $activatedAt;
  113.         return $this;
  114.     }
  115.     public function isActivated(): ?bool
  116.     {
  117.         return $this->activated;
  118.     }
  119.     public function setActivated(bool $activated): static
  120.     {
  121.         $this->activated $activated;
  122.         return $this;
  123.     }
  124. }