mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-31 01:34:12 +02:00
Db: add new helper listing external objects...
...of a given type
This commit is contained in:
parent
9921749340
commit
e35aa18230
@ -718,6 +718,23 @@ class Db extends DbConnection
|
||||
return $this->enum('icinga_' . $type, null, $filters);
|
||||
}
|
||||
|
||||
public function listExternal($type)
|
||||
{
|
||||
$table = IcingaObject::createByType($type)->getTableName();
|
||||
|
||||
$select = $this->db()->select()->from(
|
||||
array('o' => $table),
|
||||
array('object_name' => 'o.object_name')
|
||||
)->where(
|
||||
'object_type = ?',
|
||||
'external_object'
|
||||
)->order('o.object_name');
|
||||
|
||||
$res = $this->db()->fetchCol($select);
|
||||
|
||||
return array_combine($res, $res);
|
||||
}
|
||||
|
||||
public function fetchDistinctHostVars()
|
||||
{
|
||||
$select = $this->db()->select()->distinct()->from(
|
||||
|
Loading…
x
Reference in New Issue
Block a user