ImportSource: add failsafe getSetting() method
This commit is contained in:
parent
a7f11f7702
commit
0b052bb05a
|
@ -52,6 +52,15 @@ class ImportSource extends DbObject
|
|||
return $this->settings;
|
||||
}
|
||||
|
||||
public function getSetting($name, $default = null)
|
||||
{
|
||||
if (array_key_exists($name, $this->settings)) {
|
||||
return $this->settings[$name];
|
||||
}
|
||||
|
||||
return $default;
|
||||
}
|
||||
|
||||
protected function onStore()
|
||||
{
|
||||
$old = $this->fetchSettingsFromDb();
|
||||
|
|
Loading…
Reference in New Issue