mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-29 00:34:05 +02:00
Exporter: support booleans for DbObjects
This commit is contained in:
parent
21d913e232
commit
cc211fbdfb
@ -3,6 +3,7 @@
|
|||||||
namespace Icinga\Module\Director\Data;
|
namespace Icinga\Module\Director\Data;
|
||||||
|
|
||||||
use gipfl\ZfDb\Adapter\Adapter;
|
use gipfl\ZfDb\Adapter\Adapter;
|
||||||
|
use Icinga\Module\Director\Data\Db\DbDataFormatter;
|
||||||
use Icinga\Module\Director\Data\Db\DbObject;
|
use Icinga\Module\Director\Data\Db\DbObject;
|
||||||
use Icinga\Module\Director\Data\Db\DbObjectWithSettings;
|
use Icinga\Module\Director\Data\Db\DbObjectWithSettings;
|
||||||
use Icinga\Module\Director\Db;
|
use Icinga\Module\Director\Db;
|
||||||
@ -246,6 +247,12 @@ class Exporter
|
|||||||
protected function exportDbObject(DbObject $object)
|
protected function exportDbObject(DbObject $object)
|
||||||
{
|
{
|
||||||
$props = $object->getProperties();
|
$props = $object->getProperties();
|
||||||
|
foreach ($props as $key => &$value) {
|
||||||
|
if ($object->propertyIsBoolean($key)) {
|
||||||
|
$value = DbDataFormatter::booleanForDbValue($value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
unset($value);
|
||||||
if ($object instanceof DbObjectWithSettings) {
|
if ($object instanceof DbObjectWithSettings) {
|
||||||
if ($object instanceof InstantiatedViaHook) {
|
if ($object instanceof InstantiatedViaHook) {
|
||||||
$props['settings'] = (object) $object->getInstance()->exportSettings();
|
$props['settings'] = (object) $object->getInstance()->exportSettings();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user