Config Variables - Improve config variable system and initialize variables during setup.

This commit is contained in:
2024-12-12 15:38:28 +01:00
parent 28afb11ac4
commit dcd0b5f064
10 changed files with 175 additions and 58 deletions
+6 -6
View File
@@ -3,22 +3,22 @@
namespace App\Entity;
use App\Repository\ConfigVariableRepository;
use App\Enum\ConfigSectionType;
use App\Enum\ConfigVariableSectionEnum;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: ConfigVariableRepository::class)]
class ConfigVariable
{
#[ORM\Id]
#[ORM\GeneratedValue("NONE")]
#[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: ConfigSectionType::class, nullable: false)]
private ConfigSectionType $section = ConfigSectionType::General;
#[ORM\Column(type: 'string', enumType: ConfigVariableSectionEnum::class, nullable: false)]
private ConfigVariableSectionEnum $section = ConfigVariableSectionEnum::Internal;
public function getKey(): string
@@ -45,12 +45,12 @@ class ConfigVariable
return $this;
}
public function getSection(): ConfigSectionType
public function getSection(): ConfigVariableSectionEnum
{
return $this->section;
}
public function setSection(ConfigSectionType $section): static
public function setSection(ConfigVariableSectionEnum $section): static
{
$this->section = $section;