46 lines
970 B
PHP
46 lines
970 B
PHP
<?php
|
|
|
|
namespace App\Service;
|
|
|
|
use App\Entity\ConfigVariable;
|
|
use App\Repository\ConfigVariableRepository;
|
|
|
|
use Doctrine\Common\Collections\ArrayCollection;
|
|
|
|
/**
|
|
* Service to manage config variables.
|
|
*/
|
|
class ConfigVariableService
|
|
{
|
|
|
|
public function __construct(
|
|
private ConfigVariableRepository $repoVariables
|
|
) {}
|
|
|
|
public function getVariable(string $key) {
|
|
$var = $this->repoVariables->findVariableByKey($key);
|
|
}
|
|
|
|
/**
|
|
* Create and init all variables.
|
|
* To be used during Setup process.
|
|
*/
|
|
public function InitVariablesOnSetup(): void {
|
|
|
|
$entityManager = $this->repoVariables->getEntityManager();
|
|
$entityManager->beginTransaction();
|
|
|
|
try {
|
|
|
|
}
|
|
catch (\Throwable $th) {
|
|
$entityManager->rollback();
|
|
throw $th;
|
|
}
|
|
}
|
|
|
|
private function AddConfigVariable(string $key, string $value, string $section): void {
|
|
|
|
}
|
|
|
|
} |