mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2025-12-30 00:53:50 +00:00
allow setting a default value (#6908)
This commit is contained in:
@@ -66,7 +66,7 @@ class settings {
|
||||
* @param text category
|
||||
* @param text subcategory
|
||||
*/
|
||||
public function get($category = null, $subcategory = null) {
|
||||
public function get(string $category = null, string $subcategory = null, mixed $default_value = null): mixed {
|
||||
|
||||
if (empty($category)) {
|
||||
return $this->settings;
|
||||
@@ -75,7 +75,7 @@ class settings {
|
||||
return $this->settings[$category];
|
||||
}
|
||||
else {
|
||||
return $this->settings[$category][$subcategory];
|
||||
return $this->settings[$category][$subcategory] ?? $default_value;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user