<?php
namespace App\Entity;
use App\Repository\RefreshTokensRepository;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: RefreshTokensRepository::class)]
class RefreshTokens
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\Column(type: 'string', length: 255)]
private $token;
#[ORM\Column(type: 'datetime')]
private $modified;
#[ORM\Column(type: 'datetime')]
private $created;
#[ORM\ManyToOne(targetEntity: ApiDetails::class, inversedBy: 'refreshTokens')]
private $api;
public function __construct()
{
$this->setCreated(new \DateTime());
if ($this->getModified() == null) {
$this->setModified(new \DateTime());
}
}
public function getId(): ?int
{
return $this->id;
}
public function getToken(): ?string
{
return $this->token;
}
public function setToken(string $token): self
{
$this->token = $token;
return $this;
}
public function getModified(): ?\DateTimeInterface
{
return $this->modified;
}
public function setModified(\DateTimeInterface $modified): self
{
$this->modified = $modified;
return $this;
}
public function getCreated(): ?\DateTimeInterface
{
return $this->created;
}
public function setCreated(\DateTimeInterface $created): self
{
$this->created = $created;
return $this;
}
public function getApiDetails(): ?ApiDetails
{
return $this->api;
}
public function setApiDetails(?ApiDetails $api): self
{
$this->api = $api;
return $this;
}
}