mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-28 08:14:04 +02:00
parent
14e5aa8da4
commit
8ed76d4888
@ -94,12 +94,21 @@ class ImportSource extends DbObjectWithSettings
|
|||||||
{
|
{
|
||||||
$modifiers = $this->getRowModifiers();
|
$modifiers = $this->getRowModifiers();
|
||||||
|
|
||||||
|
$rejected = [];
|
||||||
|
|
||||||
if (! empty($modifiers)) {
|
if (! empty($modifiers)) {
|
||||||
foreach ($data as &$row) {
|
foreach ($data as $key => &$row) {
|
||||||
$this->applyModifiersToRow($row);
|
$this->applyModifiersToRow($row);
|
||||||
|
if (null === $row) {
|
||||||
|
$rejected[] = $row;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foreach ($rejected as $key) {
|
||||||
|
unset($data[$key]);
|
||||||
|
}
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -116,7 +125,7 @@ class ImportSource extends DbObjectWithSettings
|
|||||||
foreach ($mods as $mod) {
|
foreach ($mods as $mod) {
|
||||||
$this->applyPropertyModifierToRow($mod, $key, $row);
|
$this->applyPropertyModifierToRow($mod, $key, $row);
|
||||||
if (null === $row) {
|
if (null === $row) {
|
||||||
return $this;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -154,6 +163,9 @@ class ImportSource extends DbObjectWithSettings
|
|||||||
$row->$target = $modifier->transform($value);
|
$row->$target = $modifier->transform($value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($modifier->rejectsRow()) {
|
||||||
|
$row = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getRowModifiers()
|
public function getRowModifiers()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user