mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2026-06-21 07:09:00 -04:00
33 lines
593 B
PHP
33 lines
593 B
PHP
<?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;
|
|
}
|
|
}
|