summaryrefslogtreecommitdiffstats
path: root/library/Director/PropertyModifier/PropertyModifierRenameColumn.php
blob: 12524d5511ec77b3e0ddc4d5073af9c4ab8c11f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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;
    }
}