IcingaAddServiceForm: use branches

This commit is contained in:
Thomas Gelf 2021-10-06 03:27:05 +02:00
parent 6201fb52e4
commit 95c8884ea6
1 changed files with 4 additions and 3 deletions

View File

@ -161,10 +161,11 @@ class IcingaAddServiceForm extends DirectorObjectForm
$plain = $this->object->toPlainObject();
$db = $this->object->getConnection();
// TODO: Test this:
foreach ($this->hosts as $host) {
IcingaService::fromPlainObject($plain, $db)
->set('host_id', $host->get('id'))
->store();
$service = IcingaService::fromPlainObject($plain, $db)
->set('host_id', $host->get('id'));
$this->getDbObjectStore()->store($service);
}
$msg = sprintf(