src/Entity/Account/SsoAppSession.php line 18

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Account;
  3. use App\Entity\App\App;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Doctrine\ORM\Mapping\JoinColumn;
  6. use DrosalysWeb\ObjectExtensions\Timestamp\Model\CreatedTimestampInterface;
  7. use DrosalysWeb\ObjectExtensions\Timestamp\Model\CreatedTimestampTrait;
  8. #[
  9.     ORM\Entity(),
  10.     ORM\Table('account_sso_app_session'),
  11.     ORM\Index(columns: ['user_id''app_id']),
  12.     ORM\Index(columns: ['session_id']),
  13.     ORM\UniqueConstraint(columns: ['app_id''session_id']),
  14. ]
  15. class SsoAppSession implements CreatedTimestampInterface
  16. {
  17.     use CreatedTimestampTrait;
  18.     #[ORM\IdORM\GeneratedValueORM\Column(type'integer'nullablefalse)]
  19.     private ?int $id null;
  20.     #[ORM\ManyToOne(targetEntityUser::class, fetch'EAGER')]
  21.     #[JoinColumn(nullablefalseonDelete'CASCADE')]
  22.     private ?User $user null;
  23.     #[ORM\ManyToOne(targetEntityApp::class, fetch'EAGER')]
  24.     #[JoinColumn(nullablefalseonDelete'CASCADE')]
  25.     private ?App $app null;
  26.     #[ORM\Column(type'string'length255nullablefalse)]
  27.     private ?string $sessionId null;
  28.     #[ORM\Column(type'string'length64nullablefalse)]
  29.     private ?string $deviceId null;
  30.     #[ORM\Column(type'text'nullablefalse)]
  31.     private ?String $userAgent null;
  32.     #[ORM\Column(type'string'length45nullablefalse)]
  33.     private ?string $ipAddress null;
  34.     #[ORM\Column(type'datetime_immutable'nullabletrue)]
  35.     private ?\DateTimeImmutable $revokedAt null;
  36.     public function getId(): ?int
  37.     {
  38.         return $this->id;
  39.     }
  40.     public function getUser(): ?User
  41.     {
  42.         return $this->user;
  43.     }
  44.     public function setUser(?User $user): SsoAppSession
  45.     {
  46.         $this->user $user;
  47.         return $this;
  48.     }
  49.     public function getApp(): ?App
  50.     {
  51.         return $this->app;
  52.     }
  53.     public function setApp(?App $app): SsoAppSession
  54.     {
  55.         $this->app $app;
  56.         return $this;
  57.     }
  58.     public function getSessionId(): ?string
  59.     {
  60.         return $this->sessionId;
  61.     }
  62.     public function setSessionId(?string $sessionId): SsoAppSession
  63.     {
  64.         $this->sessionId $sessionId;
  65.         return $this;
  66.     }
  67.     public function getDeviceId(): ?string
  68.     {
  69.         return $this->deviceId;
  70.     }
  71.     public function setDeviceId(?string $deviceId): SsoAppSession
  72.     {
  73.         $this->deviceId $deviceId;
  74.         return $this;
  75.     }
  76.     public function getUserAgent(): ?string
  77.     {
  78.         return $this->userAgent;
  79.     }
  80.     public function setUserAgent(?string $userAgent): SsoAppSession
  81.     {
  82.         $this->userAgent $userAgent;
  83.         return $this;
  84.     }
  85.     public function getIpAddress(): ?string
  86.     {
  87.         return $this->ipAddress;
  88.     }
  89.     public function setIpAddress(?string $ipAddress): SsoAppSession
  90.     {
  91.         $this->ipAddress $ipAddress;
  92.         return $this;
  93.     }
  94.     public function getRevokedAt(): ?\DateTimeImmutable
  95.     {
  96.         return $this->revokedAt;
  97.     }
  98.     public function setRevokedAt(?\DateTimeImmutable $revokedAt): SsoAppSession
  99.     {
  100.         $this->revokedAt $revokedAt;
  101.         return $this;
  102.     }
  103. }