Changed Config Variables database and other entities.

This commit is contained in:
2024-09-09 12:11:24 +02:00
parent 8c6a70b0be
commit 82bd51e6f0
7 changed files with 135 additions and 23 deletions
+14 -15
View File
@@ -3,31 +3,25 @@
namespace App\Entity;
use App\Repository\ConfigVariableRepository;
use App\Enum\ConfigSectionType;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: ConfigVariableRepository::class)]
class ConfigVariable
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 32, unique: true)]
private ?string $key = null;
#[ORM\GeneratedValue("NONE")]
#[ORM\Column(length: 32, unique: true, nullable: false)]
private string $key = "";
#[ORM\Column(length: 255)]
private ?string $value = null;
#[ORM\Column(length: 64, nullable: true)]
private ?string $section = null;
#[ORM\Column(type: 'string', enumType: ConfigSectionType::class, nullable: false)]
private ConfigSectionType $section = ConfigSectionType::General;
public function getId(): ?int
{
return $this->id;
}
public function getKey(): ?string
public function getKey(): string
{
return $this->key;
}
@@ -51,15 +45,20 @@ class ConfigVariable
return $this;
}
public function getSection(): ?string
public function getSection(): ConfigSectionType
{
return $this->section;
}
public function setSection(?string $section): static
public function setSection(ConfigSectionType $section): static
{
$this->section = $section;
return $this;
}
function __toString(): string
{
return $this->getKey();
}
}