mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-30 17:24:18 +02:00
DbObjectWithSettings: fix for unstored objects
This commit is contained in:
parent
bdb1ec8473
commit
31b2326e1e
@ -139,10 +139,15 @@ abstract class DbObjectWithSettings extends DbObject
|
|||||||
protected function fetchSettingsFromDb()
|
protected function fetchSettingsFromDb()
|
||||||
{
|
{
|
||||||
$db = $this->getDb();
|
$db = $this->getDb();
|
||||||
|
$id = $this->get('id');
|
||||||
|
if (! $id) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
return $db->fetchPairs(
|
return $db->fetchPairs(
|
||||||
$db->select()
|
$db->select()
|
||||||
->from($this->settingsTable, ['setting_name', 'setting_value'])
|
->from($this->settingsTable, ['setting_name', 'setting_value'])
|
||||||
->where($this->settingsRemoteId . ' = ?', $this->get('id'))
|
->where($this->settingsRemoteId . ' = ?', $id)
|
||||||
->order('setting_name')
|
->order('setting_name')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user