src/Database/Domain/Entity/Sessions/ActiveSessions/ActiveSessionTab.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Database\Domain\Entity\Sessions\ActiveSessions;
  3. use App\Database\Domain\Entity\AbstractEntity;
  4. use App\Database\Domain\Traits\CreationDateTrait;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7.  * @ORM\Entity()
  8.  */
  9. class ActiveSessionTab extends AbstractEntity
  10. {
  11.     use CreationDateTrait;
  12.     /**
  13.      * @ORM\Column(type="string", nullable=false)
  14.      */
  15.     private string $name;
  16.     /**
  17.      * @ORM\Column(type="text")
  18.      */
  19.     private string $url;
  20.     /**
  21.      * @ORM\Column(type="text", nullable=true)
  22.      */
  23.     private ?string $icon;
  24.     /**
  25.      * @ORM\ManyToOne(targetEntity="App\Database\Domain\Entity\Sessions\ActiveSessions\ActiveDevice", inversedBy="tabs")
  26.      *
  27.      * @ORM\JoinColumn(onDelete="CASCADE")
  28.      */
  29.     private ActiveDevice $device;
  30.     /**
  31.      * @ORM\Column(type="integer", nullable=false, options={"default": 0})
  32.      */
  33.     private int $orderIndex 0;
  34.     /**
  35.      * @ORM\Column(type="boolean", nullable=false, options={"default": 0})
  36.      */
  37.     private ?bool $isPin false;
  38.     public function __construct($idActiveDevice $devicestring $namestring $url, ?string $icon null)
  39.     {
  40.         $this->id $id;
  41.         $this->device $device;
  42.         $this->name $name;
  43.         $this->url $url;
  44.         $this->icon $icon;
  45.         $this->creationDate = new \DateTimeImmutable();
  46.         $this->isPin false;
  47.     }
  48.     public function getName(): string
  49.     {
  50.         return $this->name;
  51.     }
  52.     public function setName(string $name): void
  53.     {
  54.         $this->name $name;
  55.     }
  56.     public function getUrl(): string
  57.     {
  58.         return $this->url;
  59.     }
  60.     public function setUrl(string $url): void
  61.     {
  62.         $this->url $url;
  63.     }
  64.     public function getIcon(): ?string
  65.     {
  66.         return $this->icon;
  67.     }
  68.     public function setIcon(?string $icon): void
  69.     {
  70.         $this->icon $icon;
  71.     }
  72.     public function getDevice(): ActiveDevice
  73.     {
  74.         return $this->device;
  75.     }
  76.     public function setDevice(ActiveDevice $device): void
  77.     {
  78.         $this->device $device;
  79.     }
  80.     public function getOrderIndex(): int
  81.     {
  82.         return $this->orderIndex;
  83.     }
  84.     public function setOrderIndex(int $orderIndex): void
  85.     {
  86.         $this->orderIndex $orderIndex;
  87.     }
  88.     public function getIsPin(): ?bool
  89.     {
  90.         return $this->isPin;
  91.     }
  92.     public function setIsPin(?bool $isPin): void
  93.     {
  94.         $this->isPin $isPin;
  95.     }
  96. }