src/Entity/OAuth2UserConsent.php line 12

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\OAuth2UserConsentRepository;
  4. use DateTimeImmutable;
  5. use Doctrine\DBAL\Types\Types;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use League\Bundle\OAuth2ServerBundle\Model\Client;
  8. #[ORM\Entity(repositoryClassOAuth2UserConsentRepository::class)]
  9. class OAuth2UserConsent
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     private ?int $id null;
  15.     #[ORM\Column]
  16.     private ?DateTimeImmutable $created null;
  17.     #[ORM\Column(nullabletrue)]
  18.     private ?DateTimeImmutable $expires null;
  19.     #[ORM\Column(typeTypes::SIMPLE_ARRAYnullabletrue)]
  20.     private array $scopes = [];
  21.     #[ORM\Column(length255nullabletrue)]
  22.     private ?string $ipAddress null;
  23.     #[ORM\ManyToOne(cascade: ['persist''remove'])]
  24.     #[ORM\JoinColumn(referencedColumnName'identifier'nullablefalse)]
  25.     private ?Client $client null;
  26.     #[ORM\ManyToOne(inversedBy'oAuth2UserConsents')]
  27.     #[ORM\JoinColumn(nullablefalse)]
  28.     private ?User $user null;
  29.     public function getId(): ?int
  30.     {
  31.         return $this->id;
  32.     }
  33.     public function getUser(): ?User
  34.     {
  35.         return $this->user;
  36.     }
  37.     public function setUser(User $user): self
  38.     {
  39.         $this->user $user;
  40.         return $this;
  41.     }
  42.     public function getCreated(): ?DateTimeImmutable
  43.     {
  44.         return $this->created;
  45.     }
  46.     public function setCreated(DateTimeImmutable $created): self
  47.     {
  48.         $this->created $created;
  49.         return $this;
  50.     }
  51.     public function getExpires(): ?DateTimeImmutable
  52.     {
  53.         return $this->expires;
  54.     }
  55.     public function setExpires(?DateTimeImmutable $expires): self
  56.     {
  57.         $this->expires $expires;
  58.         return $this;
  59.     }
  60.     public function getScopes(): array
  61.     {
  62.         return $this->scopes;
  63.     }
  64.     public function setScopes(?array $scopes): self
  65.     {
  66.         $this->scopes $scopes;
  67.         return $this;
  68.     }
  69.     public function getIpAddress(): ?string
  70.     {
  71.         return $this->ipAddress;
  72.     }
  73.     public function setIpAddress(?string $ipAddress): self
  74.     {
  75.         $this->ipAddress $ipAddress;
  76.         return $this;
  77.     }
  78.     public function getClient(): ?Client
  79.     {
  80.         return $this->client;
  81.     }
  82.     public function setClient(Client $client): self
  83.     {
  84.         $this->client $client;
  85.         return $this;
  86.     }
  87. }