mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-28 16:24:05 +02:00
CoreApi: fetch only non-director Apis for import
This commit is contained in:
parent
0a737f9c4f
commit
1f119adaa3
@ -26,11 +26,15 @@ class CoreApi
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getObjects($name, $pluraltype, $attrs = array())
|
public function getObjects($name, $pluraltype, $attrs = array(), $ignorePackage = null)
|
||||||
{
|
{
|
||||||
$name = strtolower($name);
|
$name = strtolower($name);
|
||||||
$params = (object) array(
|
$params = (object) array(
|
||||||
);
|
);
|
||||||
|
if ($ignorePackage) {
|
||||||
|
$params->filter = 'obj.package!="' . $ignorePackage . '"';
|
||||||
|
}
|
||||||
|
|
||||||
if (! empty($attrs)) {
|
if (! empty($attrs)) {
|
||||||
$params->attrs = $attrs;
|
$params->attrs = $attrs;
|
||||||
}
|
}
|
||||||
@ -45,6 +49,7 @@ class CoreApi
|
|||||||
{
|
{
|
||||||
$params = (object) array(
|
$params = (object) array(
|
||||||
);
|
);
|
||||||
|
|
||||||
if (! empty($attrs)) {
|
if (! empty($attrs)) {
|
||||||
$params->attrs = $attrs;
|
$params->attrs = $attrs;
|
||||||
}
|
}
|
||||||
@ -133,7 +138,7 @@ constants
|
|||||||
);
|
);
|
||||||
|
|
||||||
$objects = array();
|
$objects = array();
|
||||||
$result = $this->getObjects($single, $plural, $attrs);
|
$result = $this->getObjects($single, $plural, $attrs, 'director');
|
||||||
foreach ($result as $name => $row) {
|
foreach ($result as $name => $row) {
|
||||||
$attrs = $row->attrs;
|
$attrs = $row->attrs;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user