2023-04-05 15:29:58 -04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/*
|
|
|
|
| Welcome to the Blueprint Extension Library.
|
|
|
|
|
|
2023-04-11 14:48:17 -04:00
|
|
|
| This allows developers to interact with
|
|
|
|
| Pterodactyl easely and without hassle.
|
2023-04-05 15:29:58 -04:00
|
|
|
*/
|
|
|
|
|
|
|
|
namespace Pterodactyl\Services\Helpers;
|
|
|
|
|
2023-04-14 11:18:24 -04:00
|
|
|
use Pterodactyl\Contracts\Repository\SettingsRepositoryInterface;
|
|
|
|
|
2023-04-05 15:29:58 -04:00
|
|
|
class BlueprintExtensionLibrary
|
|
|
|
{
|
|
|
|
// Construct BlueprintExtensionLibrary
|
|
|
|
public function __construct(
|
|
|
|
private SettingsRepositoryInterface $settings,
|
|
|
|
) {
|
|
|
|
}
|
|
|
|
|
2023-04-14 11:18:24 -04:00
|
|
|
public function db($type, $one, $two) {
|
2023-04-05 15:29:58 -04:00
|
|
|
if ($type === "get") {
|
2023-04-14 11:18:24 -04:00
|
|
|
return $this->settings->get($one."::".$two);
|
2023-04-05 15:29:58 -04:00
|
|
|
};
|
|
|
|
if ($type === "set") {
|
2023-04-14 11:18:24 -04:00
|
|
|
return $this->settings->set($one, $two);
|
2023-04-05 15:29:58 -04:00
|
|
|
};
|
|
|
|
return true;
|
|
|
|
}
|
2023-03-26 12:18:54 -04:00
|
|
|
}
|