src/Entity/CRM/Api.php line 13

  1. <?php
  2. namespace App\Entity\CRM;
  3. use App\Repository\ApiRepository;
  4. use Doctrine\DBAL\Types\Types;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Symfony\Component\Security\Core\User\EquatableInterface;
  7. use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
  8. use Symfony\Component\Security\Core\User\UserInterface;
  9. #[ORM\Entity(repositoryClassApiRepository::class)]
  10. class Api implements UserInterfacePasswordAuthenticatedUserInterfaceEquatableInterface
  11. {
  12.     #[ORM\Id]
  13.     #[ORM\GeneratedValue]
  14.     #[ORM\Column]
  15.     private ?int $id null;
  16.     #[ORM\Column(length255)]
  17.     private ?string $email null;
  18.     #[ORM\Column(length255)]
  19.     private ?string $password null;
  20.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  21.     private ?string $note null;
  22.     #[ORM\Column]
  23.     private ?bool $isActive null;
  24.     public function getId(): ?int
  25.     {
  26.         return $this->id;
  27.     }
  28.     public function getEmail(): ?string
  29.     {
  30.         return $this->email;
  31.     }
  32.     public function setEmail(string $email): static
  33.     {
  34.         $this->email $email;
  35.         return $this;
  36.     }
  37.     /**
  38.      * @see PasswordAuthenticatedUserInterface
  39.      */
  40.     public function getPassword(): string
  41.     {
  42.         return $this->password;
  43.     }
  44.     public function setPassword(string $password): self
  45.     {
  46.         $this->password $password;
  47.         return $this;
  48.     }
  49.     public function getNote(): ?string
  50.     {
  51.         return $this->note;
  52.     }
  53.     public function setNote(?string $note): static
  54.     {
  55.         $this->note $note;
  56.         return $this;
  57.     }
  58.     public function isIsActive(): ?bool
  59.     {
  60.         return $this->isActive;
  61.     }
  62.     public function setIsActive(bool $isActive): static
  63.     {
  64.         $this->isActive $isActive;
  65.         return $this;
  66.     }
  67.     public function isEqualTo(Admin|UserInterface $user): bool
  68.     {
  69.         if (!$user->isActive()) {
  70.             return false;
  71.         }
  72.         return true;
  73.     }
  74.     public function getRoles(): array
  75.     {
  76.         return ['ROLE_API'];
  77.     }
  78.     public function eraseCredentials()
  79.     {
  80.     }
  81.     public function getUserIdentifier(): string
  82.     {
  83.         return (string)$this->email;
  84.     }
  85. }