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\Id, ORM\GeneratedValue, ORM\Column(type: 'integer', nullable: false)]
  19. private ?int $id = null;
  20. #[ORM\ManyToOne(targetEntity: User::class, fetch: 'EAGER')]
  21. #[JoinColumn(nullable: false, onDelete: 'CASCADE')]
  22. private ?User $user = null;
  23. #[ORM\ManyToOne(targetEntity: App::class, fetch: 'EAGER')]
  24. #[JoinColumn(nullable: false, onDelete: 'CASCADE')]
  25. private ?App $app = null;
  26. #[ORM\Column(type: 'string', length: 255, nullable: false)]
  27. private ?string $sessionId = null;
  28. #[ORM\Column(type: 'string', length: 64, nullable: false)]
  29. private ?string $deviceId = null;
  30. #[ORM\Column(type: 'text', nullable: false)]
  31. private ?String $userAgent = null;
  32. #[ORM\Column(type: 'string', length: 45, nullable: false)]
  33. private ?string $ipAddress = null;
  34. #[ORM\Column(type: 'datetime_immutable', nullable: true)]
  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. }