Add optional descriptions to settings

This commit is contained in:
Alexander Nell
2020-05-19 22:07:18 +02:00
parent 9b46a6e7f7
commit 7c04504e6a
4 changed files with 73 additions and 29 deletions

View File

@ -30,23 +30,25 @@ class Setting implements UsageInformationAble {
/*
* Public properties
*/
public $index = null;
public $class = null;
public $setting = null;
public $type = null;
public $value = null;
public $default = null;
public $set = null;
public $fetchTime = null;
public $index = null;
public $class = null;
public $setting = null;
public $type = null;
public $value = null;
public $default = null;
public $set = null;
public $fetchTime = null;
public $description = null;
/**
* Construct a new setting instance
*
* @param mixed $object
* @param string $settingName
* @param mixed $defaultValue
* @param mixed $object
* @param string $settingName
* @param mixed $defaultValue
* @param string|null $description
*/
public function __construct($object, $settingName, $defaultValue) {
public function __construct($object, $settingName, $defaultValue, $description = null) {
if ($object === false) {
// Fetched from Database
$this->value = $this->castValue($this->value);
@ -68,6 +70,7 @@ class Setting implements UsageInformationAble {
$this->value = $defaultValue;
}
$this->default = $this->value;
$this->description = $description;
}
}