mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-27 07:44:05 +02:00
ServiceController: object loading, id support
This commit is contained in:
parent
cef7090666
commit
ad415e4fa6
@ -43,16 +43,20 @@ class ServiceController extends ObjectController
|
|||||||
|
|
||||||
protected function loadObject()
|
protected function loadObject()
|
||||||
{
|
{
|
||||||
if ($this->object === null && $name = $this->params->get('name')) {
|
if ($this->object === null) {
|
||||||
$params = array('object_name' => $name);
|
if ($name = $this->params->get('name')) {
|
||||||
$db = $this->db();
|
$params = array('object_name' => $name);
|
||||||
|
$db = $this->db();
|
||||||
|
|
||||||
if ($hostname = $this->params->get('host')) {
|
if ($hostname = $this->params->get('host')) {
|
||||||
$this->view->host = IcingaHost::load($hostname, $db);
|
$this->view->host = IcingaHost::load($hostname, $db);
|
||||||
$params['host_id'] = $this->view->host->id;
|
$params['host_id'] = $this->view->host->id;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->object = IcingaService::load($params, $db);
|
||||||
|
} else {
|
||||||
|
parent::loadObject();
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->object = IcingaService::load($params, $db);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->object;
|
return $this->object;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user