forked from Somnia/SomniaRooms
65 lines
1.3 KiB
PHP
65 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace App\Entity;
|
|
|
|
use App\Repository\ConfigVariableRepository;
|
|
use App\Enum\ConfigVariableSectionEnum;
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
|
|
#[ORM\Entity(repositoryClass: ConfigVariableRepository::class)]
|
|
class ConfigVariable
|
|
{
|
|
#[ORM\Id]
|
|
#[ORM\GeneratedValue(strategy: "NONE")]
|
|
#[ORM\Column(length: 32, unique: true, nullable: false)]
|
|
private string $key = "";
|
|
|
|
#[ORM\Column(length: 255, nullable: false)]
|
|
private ?string $value = null;
|
|
|
|
#[ORM\Column(type: 'string', enumType: ConfigVariableSectionEnum::class, nullable: false)]
|
|
private ConfigVariableSectionEnum $section = ConfigVariableSectionEnum::Internal;
|
|
|
|
|
|
public function getKey(): string
|
|
{
|
|
return $this->key;
|
|
}
|
|
|
|
public function setKey(string $key): static
|
|
{
|
|
$this->key = $key;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getValue(): ?string
|
|
{
|
|
return $this->value;
|
|
}
|
|
|
|
public function setValue(string $value): static
|
|
{
|
|
$this->value = $value;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getSection(): ConfigVariableSectionEnum
|
|
{
|
|
return $this->section;
|
|
}
|
|
|
|
public function setSection(ConfigVariableSectionEnum $section): static
|
|
{
|
|
$this->section = $section;
|
|
|
|
return $this;
|
|
}
|
|
|
|
function __toString(): string
|
|
{
|
|
return $this->getKey();
|
|
}
|
|
}
|