mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-29 16:54:06 +02:00
PropertyModifierArrayToRow: fix on_empty
This commit is contained in:
parent
b961f16dfd
commit
2de46b819c
@ -42,13 +42,12 @@ class PropertyModifierArrayToRow extends PropertyModifierHook
|
|||||||
public function transform($value)
|
public function transform($value)
|
||||||
{
|
{
|
||||||
if (empty($value)) {
|
if (empty($value)) {
|
||||||
$onDuplicate = $this->getSetting('on_duplicate', 'reject');
|
$onDuplicate = $this->getSetting('on_empty', 'reject');
|
||||||
switch ($onDuplicate) {
|
switch ($onDuplicate) {
|
||||||
case 'reject':
|
case 'reject':
|
||||||
$this->rejectRow();
|
return [];
|
||||||
return null;
|
|
||||||
case 'keep':
|
case 'keep':
|
||||||
return null;
|
return [null];
|
||||||
case 'fail':
|
case 'fail':
|
||||||
throw new InvalidArgumentException('Failed to clone row, value is empty');
|
throw new InvalidArgumentException('Failed to clone row, value is empty');
|
||||||
default:
|
default:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user