mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-30 01:04:12 +02:00
IcingaHost: add helper methods for Sets, Services
This commit is contained in:
parent
2bf1b3f429
commit
b21ba5dc54
@ -421,6 +421,42 @@ class IcingaHost extends IcingaObject
|
|||||||
return $str;
|
return $str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return IcingaService[]
|
||||||
|
*/
|
||||||
|
public function fetchServices()
|
||||||
|
{
|
||||||
|
$connection = $this->getConnection();
|
||||||
|
$db = $connection->getDbAdapter();
|
||||||
|
|
||||||
|
/** @var IcingaService[] $services */
|
||||||
|
$services = IcingaService::loadAll(
|
||||||
|
$connection,
|
||||||
|
$db->select()->from('icinga_service')
|
||||||
|
->where('host_id = ?', $this->get('id'))
|
||||||
|
);
|
||||||
|
|
||||||
|
return $services;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return IcingaServiceSet[]
|
||||||
|
*/
|
||||||
|
public function fetchServiceSets()
|
||||||
|
{
|
||||||
|
$connection = $this->getConnection();
|
||||||
|
$db = $connection->getDbAdapter();
|
||||||
|
|
||||||
|
/** @var IcingaServiceSet[] $sets */
|
||||||
|
$sets = IcingaServiceSet::loadAll(
|
||||||
|
$connection,
|
||||||
|
$db->select()->from('icinga_service_set')
|
||||||
|
->where('host_id = ?', $this->get('id'))
|
||||||
|
);
|
||||||
|
|
||||||
|
return $sets;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user