From 2f621e553a82634e1fecd7619a84c22b45c65fb3 Mon Sep 17 00:00:00 2001 From: Aleksey Fedorenko Date: Wed, 3 Apr 2019 13:28:19 +0300 Subject: [PATCH] Add defaultValue to DbSettings ->get() --- src/components/DbSettings.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/components/DbSettings.php b/src/components/DbSettings.php index 6330aef..cd6c31a 100644 --- a/src/components/DbSettings.php +++ b/src/components/DbSettings.php @@ -104,4 +104,14 @@ protected function setValue($section, $key, $value) } return $this->insertValue($section, $key, $value); } + + /** + * {@inheritDoc} + * + * @param mixed $defaultValue Default value if $key not exists + */ + public function get($section, $key, $defaultValue = null) + { + return parent::get($section, $key) ?? $defaultValue; + } } \ No newline at end of file