src/Entity/Security/ServiceSession.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Security;
  3. use App\Entity\PrimaryIdTrait;
  4. use App\Entity\User\User;
  5. use Gedmo\Timestampable\Traits\TimestampableEntity;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity]
  8. class ServiceSession
  9. {
  10.     use TimestampableEntity;
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue(strategy'CUSTOM')]
  13.     #[ORM\CustomIdGenerator(class: 'App\Doctrine\CustomIdGenerator')]
  14.     #[ORM\Column(type'binary'length15)]
  15.     private $id;
  16.     /**
  17.      * @var User
  18.      */
  19.     #[ORM\ManyToOne(targetEntity'App\Entity\User\User'inversedBy'serviceSession')]
  20.     private $userId;
  21.     #[ORM\Column(type'string')]
  22.     private string $ipAddress;
  23.     #[ORM\Column(type'text')]
  24.     private string $userAgent;
  25.     #[ORM\Column(type'text')]
  26.     private string $token;
  27.     #[ORM\Column(type'text')]
  28.     private string $refreshToken;
  29.     /**
  30.      * @var bool
  31.      */
  32.     #[ORM\Column(type'boolean')]
  33.     protected bool $active true;
  34.     /**
  35.      * @return int
  36.      */
  37.     public function getId(): int
  38.     {
  39.         return $this->id;
  40.     }
  41.     /**
  42.      * @return User|null
  43.      */
  44.     public function getUserId(): ?User
  45.     {
  46.         return $this->userId;
  47.     }
  48.     /**
  49.      * @param User $userId
  50.      */
  51.     public function setUserId(User $userId): void
  52.     {
  53.         $this->userId $userId;
  54.     }
  55.     public function getIpAddress(): string
  56.     {
  57.         return $this->ipAddress;
  58.     }
  59.     public function setIpAddress(string $ipAddress): void
  60.     {
  61.         $this->ipAddress $ipAddress;
  62.     }
  63.     public function getUserAgent(): string
  64.     {
  65.         return $this->userAgent;
  66.     }
  67.     public function setUserAgent(?string $userAgent): void
  68.     {
  69.         $this->userAgent $userAgent;
  70.     }
  71.     public function getToken(): string
  72.     {
  73.         return $this->token;
  74.     }
  75.     public function setToken(?string $token): void
  76.     {
  77.         $this->token $token;
  78.     }
  79.     public function getRefreshToken(): string
  80.     {
  81.         return $this->refreshToken;
  82.     }
  83.     public function setRefreshToken(?string $refreshToken): void
  84.     {
  85.         $this->refreshToken $refreshToken;
  86.     }
  87.     public function getActive(): ?bool
  88.     {
  89.         return $this->active;
  90.     }
  91.     public function setActive(bool $active): self
  92.     {
  93.         $this->active $active;
  94.         return $this;
  95.     }
  96. }