what the fuck
All checks were successful
CI - Build Tonehaus Docker image / tonehaus-ci-build (push) Successful in 1m55s
All checks were successful
CI - Build Tonehaus Docker image / tonehaus-ci-build (push) Successful in 1m55s
This commit is contained in:
@@ -6,19 +6,31 @@ use App\Entity\Setting;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
/**
|
||||
* SettingRepository provides helper accessors for app configuration storage.
|
||||
*/
|
||||
class SettingRepository extends ServiceEntityRepository
|
||||
{
|
||||
/**
|
||||
* Injects the Doctrine registry reference.
|
||||
*/
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
{
|
||||
parent::__construct($registry, Setting::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a setting value falling back to the supplied default.
|
||||
*/
|
||||
public function getValue(string $name, ?string $default = null): ?string
|
||||
{
|
||||
$setting = $this->findOneBy(['name' => $name]);
|
||||
return $setting?->getValue() ?? $default;
|
||||
}
|
||||
|
||||
/**
|
||||
* Persists the supplied configuration value.
|
||||
*/
|
||||
public function setValue(string $name, ?string $value): void
|
||||
{
|
||||
$em = $this->getEntityManager();
|
||||
|
||||
Reference in New Issue
Block a user