wishthis/includes/classes/options.php

29 lines
486 B
PHP
Raw Normal View History

2022-01-14 09:50:48 +00:00
<?php
/**
* options.php
*
* Store and retrieve application options.
*
* @author Jay Trees <github.jay@grandel.anonaddy.me>
*/
namespace wishthis;
class Options
{
public function __construct(private Database $database)
{
}
public function getOption(string $key): string
{
$option = $this->database->query(
'SELECT * FROM `options`
WHERE `key` = "' . $key . '";'
)->fetch();
return $option['value'];
}
}