src/Entity/Session.php line 10

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\SessionRepository;
  4. use Doctrine\DBAL\Types\Types;
  5. use Doctrine\ORM\Mapping as ORM;
  6. #[ORM\Entity(repositoryClass: SessionRepository::class)]
  7. class Session
  8. {
  9.     #[ORM\Id]
  10.     #[ORM\GeneratedValue]
  11.     #[ORM\Column]
  12.     private ?int $id = null;
  13.     #[ORM\Column(type: Types::TEXT)]
  14.     private ?string $token_user = null;
  15.     #[ORM\Column(type: Types::DATETIME_MUTABLE)]
  16.     private ?\DateTimeInterface $session_start = null;
  17.     #[ORM\Column(type: Types::DATETIME_MUTABLE)]
  18.     private ?\DateTimeInterface $session_end = null;
  19.     #[ORM\ManyToOne(inversedBy: 'sessions')]
  20.     #[ORM\JoinColumn(nullable: false)]
  21.     private ?User $user = null;
  22.     public function getId(): ?int
  23.     {
  24.         return $this->id;
  25.     }
  26.     public function getTokenUser(): ?string
  27.     {
  28.         return $this->token_user;
  29.     }
  30.     public function setTokenUser(string $token_user): self
  31.     {
  32.         $this->token_user = $token_user;
  33.         return $this;
  34.     }
  35.     public function getSessionStart(): ?\DateTimeInterface
  36.     {
  37.         return $this->session_start;
  38.     }
  39.     public function setSessionStart(\DateTimeInterface $session_start): self
  40.     {
  41.         $this->session_start = $session_start;
  42.         return $this;
  43.     }
  44.     public function getSessionEnd(): ?\DateTimeInterface
  45.     {
  46.         return $this->session_end;
  47.     }
  48.     public function setSessionEnd(\DateTimeInterface $session_end): self
  49.     {
  50.         $this->session_end = $session_end;
  51.         return $this;
  52.     }
  53.     public function getUser(): ?User
  54.     {
  55.         return $this->user;
  56.     }
  57.     public function setUser(?User $user): self
  58.     {
  59.         $this->user = $user;
  60.         return $this;
  61.     }
  62.     
  63. }