Db: add new helper listing external objects...

...of a given type
This commit is contained in:
Thomas Gelf 2016-03-21 19:12:55 +01:00
parent 9921749340
commit e35aa18230

View File

@ -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(