<?php
namespace App\Database\Domain\Entity\Sessions\ActiveSessions;
use App\Database\Domain\Entity\AbstractEntity;
use App\Database\Domain\Traits\CreationDateTrait;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity()
*/
class ActiveSessionTab extends AbstractEntity
{
use CreationDateTrait;
/**
* @ORM\Column(type="string", nullable=false)
*/
private string $name;
/**
* @ORM\Column(type="text")
*/
private string $url;
/**
* @ORM\Column(type="text", nullable=true)
*/
private ?string $icon;
/**
* @ORM\ManyToOne(targetEntity="App\Database\Domain\Entity\Sessions\ActiveSessions\ActiveDevice", inversedBy="tabs")
*
* @ORM\JoinColumn(onDelete="CASCADE")
*/
private ActiveDevice $device;
/**
* @ORM\Column(type="integer", nullable=false, options={"default": 0})
*/
private int $orderIndex = 0;
/**
* @ORM\Column(type="boolean", nullable=false, options={"default": 0})
*/
private ?bool $isPin = false;
public function __construct($id, ActiveDevice $device, string $name, string $url, ?string $icon = null)
{
$this->id = $id;
$this->device = $device;
$this->name = $name;
$this->url = $url;
$this->icon = $icon;
$this->creationDate = new \DateTimeImmutable();
$this->isPin = false;
}
public function getName(): string
{
return $this->name;
}
public function setName(string $name): void
{
$this->name = $name;
}
public function getUrl(): string
{
return $this->url;
}
public function setUrl(string $url): void
{
$this->url = $url;
}
public function getIcon(): ?string
{
return $this->icon;
}
public function setIcon(?string $icon): void
{
$this->icon = $icon;
}
public function getDevice(): ActiveDevice
{
return $this->device;
}
public function setDevice(ActiveDevice $device): void
{
$this->device = $device;
}
public function getOrderIndex(): int
{
return $this->orderIndex;
}
public function setOrderIndex(int $orderIndex): void
{
$this->orderIndex = $orderIndex;
}
public function getIsPin(): ?bool
{
return $this->isPin;
}
public function setIsPin(?bool $isPin): void
{
$this->isPin = $isPin;
}
}