ImportSourceHook: add failsafe getSetting method
This commit is contained in:
parent
5144b8bfed
commit
a7f11f7702
|
@ -301,7 +301,6 @@ class Sync
|
||||||
if ($object->hasBeenModified()) {
|
if ($object->hasBeenModified()) {
|
||||||
$object->store($db);
|
$object->store($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$dba->commit();
|
$dba->commit();
|
||||||
|
|
|
@ -64,6 +64,14 @@ abstract class ImportSourceHook
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getSetting($name, $default = null) {
|
||||||
|
if (array_key_exists($name, $this->settings)) {
|
||||||
|
return $this->settings[$name];
|
||||||
|
} else {
|
||||||
|
return $default;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns an array containing importable objects
|
* Returns an array containing importable objects
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue