<?php
namespace App\Entity;
use App\Repository\SessionRepository;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: SessionRepository::class)]
class Session
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(type: Types::TEXT)]
private ?string $token_user = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE)]
private ?\DateTimeInterface $session_start = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE)]
private ?\DateTimeInterface $session_end = null;
#[ORM\ManyToOne(inversedBy: 'sessions')]
#[ORM\JoinColumn(nullable: false)]
private ?User $user = null;
public function getId(): ?int
{
return $this->id;
}
public function getTokenUser(): ?string
{
return $this->token_user;
}
public function setTokenUser(string $token_user): self
{
$this->token_user = $token_user;
return $this;
}
public function getSessionStart(): ?\DateTimeInterface
{
return $this->session_start;
}
public function setSessionStart(\DateTimeInterface $session_start): self
{
$this->session_start = $session_start;
return $this;
}
public function getSessionEnd(): ?\DateTimeInterface
{
return $this->session_end;
}
public function setSessionEnd(\DateTimeInterface $session_end): self
{
$this->session_end = $session_end;
return $this;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(?User $user): self
{
$this->user = $user;
return $this;
}
}