mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-08-16 07:18:09 +02:00
parent
c12cf5ddb3
commit
ee2bae47f3
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace Icinga\Module\Director\PropertyModifier;
|
||||
|
||||
use Icinga\Module\Director\Hook\PropertyModifierHook;
|
||||
|
||||
class PropertyModifierRenameColumn extends PropertyModifierHook
|
||||
{
|
||||
public function getName()
|
||||
{
|
||||
return 'Rename a Property/Column';
|
||||
}
|
||||
|
||||
public function requiresRow()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function hasArraySupport()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function transform($value)
|
||||
{
|
||||
$row = $this->getRow();
|
||||
$property = $this->getPropertyName();
|
||||
if ($row) {
|
||||
unset($row->$property);
|
||||
}
|
||||
// $this->rejectRow();
|
||||
return $value;
|
||||
}
|
||||
}
|
@ -42,6 +42,7 @@ use Icinga\Module\Director\PropertyModifier\PropertyModifierParseURL;
|
||||
use Icinga\Module\Director\PropertyModifier\PropertyModifierRegexReplace;
|
||||
use Icinga\Module\Director\PropertyModifier\PropertyModifierRegexSplit;
|
||||
use Icinga\Module\Director\PropertyModifier\PropertyModifierRejectOrSelect;
|
||||
use Icinga\Module\Director\PropertyModifier\PropertyModifierRenameColumn;
|
||||
use Icinga\Module\Director\PropertyModifier\PropertyModifierReplace;
|
||||
use Icinga\Module\Director\PropertyModifier\PropertyModifierSkipDuplicates;
|
||||
use Icinga\Module\Director\PropertyModifier\PropertyModifierSplit;
|
||||
@ -110,6 +111,7 @@ $directorHooks = [
|
||||
PropertyModifierRegexReplace::class,
|
||||
PropertyModifierRegexSplit::class,
|
||||
PropertyModifierRejectOrSelect::class,
|
||||
PropertyModifierRenameColumn::class,
|
||||
PropertyModifierReplace::class,
|
||||
PropertyModifierSkipDuplicates::class,
|
||||
PropertyModifierSplit::class,
|
||||
|
Loading…
x
Reference in New Issue
Block a user