Config Variables - Improve config variable system and initialize variables during setup.
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user