Added 2 variables to BlueprintVariableService

Just for reading and writing to the Blueprint database table made simpler.
This commit is contained in:
purple 2023-02-26 14:39:44 +01:00
parent af7b4c30cb
commit 13ef819880

View file

@ -1,12 +1,14 @@
<?php
namespace Pterodactyl\Services\Helpers;
use Pterodactyl\Contracts\Repository\SettingsRepositoryInterface;
class BlueprintVariableService
{
// Construct BlueprintVariableService
public function __construct()
{
public function __construct(
private SettingsRepositoryInterface $settings,
) {
}
@ -74,4 +76,22 @@ class BlueprintVariableService
public function version(): string{
return "indev";
}
// $bp->dbGet('db:record')
public function dbGet($key): string
{
$a = $this->settings->get('blueprint::' . $key);
if(!$a) {
return "";
} else {
return $a;
};
}
// $bp->dbSet('db:record', 'value')
public function dbSet($key, $value): void
{
$this->settings->set('blueprint::' . $key, $value);
return;
}
}