parent
0568d9d0af
commit
2462fbe18f
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
|
||||
namespace Icinga\Module\Director\PropertyModifier;
|
||||
|
||||
use Icinga\Module\Director\Hook\PropertyModifierHook;
|
||||
|
||||
class PropertyModifierArrayToRow extends PropertyModifierHook
|
||||
{
|
||||
public function getName()
|
||||
{
|
||||
return 'Clone the row for every entry of an Array';
|
||||
}
|
||||
|
||||
public function hasArraySupport()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function expandsRows()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function transform($value)
|
||||
{
|
||||
if (empty($value)) {
|
||||
$this->rejectRow();
|
||||
return null;
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
}
|
|
@ -18,6 +18,7 @@ use Icinga\Module\Director\Job\ImportJob;
|
|||
use Icinga\Module\Director\Job\SyncJob;
|
||||
use Icinga\Module\Director\PropertyModifier\PropertyModifierArrayElementByPosition;
|
||||
use Icinga\Module\Director\PropertyModifier\PropertyModifierArrayFilter;
|
||||
use Icinga\Module\Director\PropertyModifier\PropertyModifierArrayToRow;
|
||||
use Icinga\Module\Director\PropertyModifier\PropertyModifierBitmask;
|
||||
use Icinga\Module\Director\PropertyModifier\PropertyModifierCombine;
|
||||
use Icinga\Module\Director\PropertyModifier\PropertyModifierDnsRecords;
|
||||
|
@ -79,6 +80,7 @@ $directorHooks = [
|
|||
'director/PropertyModifier' => [
|
||||
PropertyModifierArrayElementByPosition::class,
|
||||
PropertyModifierArrayFilter::class,
|
||||
PropertyModifierArrayToRow::class,
|
||||
PropertyModifierBitmask::class,
|
||||
PropertyModifierCombine::class,
|
||||
PropertyModifierDnsRecords::class,
|
||||
|
|
Loading…
Reference in New Issue