ImportSource: add failsafe getSetting() method

This commit is contained in:
Thomas Gelf 2015-12-03 01:37:10 +01:00
parent a7f11f7702
commit 0b052bb05a
1 changed files with 9 additions and 0 deletions

View File

@ -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();