Added 2 variables to BlueprintVariableService
Just for reading and writing to the Blueprint database table made simpler.
This commit is contained in:
parent
af7b4c30cb
commit
13ef819880
1 changed files with 22 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue