Import: allow for simple objects (hashes, dicts)

This commit is contained in:
Thomas Gelf 2015-10-28 22:31:37 +01:00
parent e317b7cf6d
commit 139b52079f
1 changed files with 4 additions and 0 deletions

View File

@ -6,6 +6,7 @@ use Icinga\Module\Director\Objects\ImportSource;
use Icinga\Module\Director\Util;
use Icinga\Module\Director\Web\Hook\ImportSourceHook;
use Icinga\Exception\IcingaException;
use stdClass;
class Import
{
@ -59,6 +60,9 @@ class Import
if (is_array($pval)) {
$pval = json_encode($pval);
$format = 'json';
} elseif ($pval instanceof stdClass) {
$pval = json_encode($pval);
$format = 'json';
} else {
$format = 'string';
}