ImportsourceHookTable: use PlainObjectRenderer

This commit is contained in:
Thomas Gelf 2017-08-18 21:48:28 +02:00
parent 719ca9d271
commit ffb0177a16
1 changed files with 16 additions and 0 deletions

View File

@ -5,6 +5,7 @@ namespace Icinga\Module\Director\Web\Table;
use Icinga\Data\DataArray\ArrayDatasource;
use Icinga\Module\Director\Hook\ImportSourceHook;
use Icinga\Module\Director\Objects\ImportSource;
use Icinga\Module\Director\PlainObjectRenderer;
use ipl\Web\Table\SimpleQueryBasedTable;
class ImportsourceHookTable extends SimpleQueryBasedTable
@ -50,6 +51,21 @@ class ImportsourceHookTable extends SimpleQueryBasedTable
return $this->getColumns();
}
public function renderRow($row)
{
$tr = $this::tr();
foreach ($this->getColumnsToBeRendered() as $column) {
$td = $this::td();
if (property_exists($row, $column)) {
$td->setContent(PlainObjectRenderer::render($row->$column));
}
$tr->add($td);
}
return $tr;
}
protected function sourceHook()
{
if ($this->sourceHook === null) {