mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-28 16:24:05 +02:00
IcingaService: override setKey, allows for...
...different kind of links (host/service name VS id)
This commit is contained in:
parent
e09459625d
commit
8cc7b0834e
@ -85,6 +85,23 @@ class IcingaService extends IcingaObject
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function setKey($key)
|
||||||
|
{
|
||||||
|
if (is_int($key)) {
|
||||||
|
$this->id = $key;
|
||||||
|
} elseif (is_array($key)) {
|
||||||
|
foreach (array('id', 'host_id', 'object_name') as $k) {
|
||||||
|
if (array_key_exists($k, $key)) {
|
||||||
|
$this->set($k, $key[$k]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return parent::setKey($key);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Render host_id as host_name
|
* Render host_id as host_name
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user