79 lines
1.7 KiB
PHP
79 lines
1.7 KiB
PHP
<?php
|
|
|
|
namespace App\Entity;
|
|
|
|
use App\Repository\RemotePCRepository;
|
|
use Doctrine\DBAL\Types\Types;
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
|
|
#[ORM\Entity(repositoryClass: RemotePCRepository::class)]
|
|
#[ORM\Table(name: 'remote_pc')]
|
|
class RemotePC extends AbstractEntity
|
|
{
|
|
#[ORM\OneToOne(inversedBy: 'remotePC')]
|
|
#[ORM\JoinColumn(nullable: false, onDelete: 'CASCADE')]
|
|
private Client $client;
|
|
|
|
#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
|
|
private ?\DateTimeInterface $reservedUntil = null;
|
|
|
|
#[ORM\Column(length: 512, nullable: true)]
|
|
private ?string $urlLogin = null;
|
|
|
|
#[ORM\Column(length: 512, nullable: true)]
|
|
private ?string $urlLogout = null;
|
|
|
|
public function getClient(): Client
|
|
{
|
|
return $this->client;
|
|
}
|
|
|
|
public function setClient(Client $client): static
|
|
{
|
|
$this->client = $client;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getReservedUntil(): ?\DateTimeInterface
|
|
{
|
|
return $this->reservedUntil;
|
|
}
|
|
|
|
public function setReservedUntil(?\DateTimeInterface $reservedUntil): static
|
|
{
|
|
$this->reservedUntil = $reservedUntil;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function isReservedActive(): bool
|
|
{
|
|
return $this->reservedUntil !== null && $this->reservedUntil > new \DateTime();
|
|
}
|
|
|
|
public function getUrlLogin(): ?string
|
|
{
|
|
return $this->urlLogin;
|
|
}
|
|
|
|
public function setUrlLogin(?string $urlLogin): static
|
|
{
|
|
$this->urlLogin = $urlLogin;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getUrlLogout(): ?string
|
|
{
|
|
return $this->urlLogout;
|
|
}
|
|
|
|
public function setUrlLogout(?string $urlLogout): static
|
|
{
|
|
$this->urlLogout = $urlLogout;
|
|
|
|
return $this;
|
|
}
|
|
}
|