From 985d03d5f2e6457ab900042491b9071d7e0ac53c Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Fri, 21 Jul 2017 12:07:28 +0200 Subject: [PATCH] IcingaCommandArgumentTable: improve readability --- .../Web/Table/IcingaCommandArgumentTable.php | 27 +++++++------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/library/Director/Web/Table/IcingaCommandArgumentTable.php b/library/Director/Web/Table/IcingaCommandArgumentTable.php index 91fa4a0d..8e243231 100644 --- a/library/Director/Web/Table/IcingaCommandArgumentTable.php +++ b/library/Director/Web/Table/IcingaCommandArgumentTable.php @@ -31,14 +31,10 @@ class IcingaCommandArgumentTable extends ZfQueryBasedTable public function renderRow($row) { return $this::row([ - Link::create( - $row->argument_name, - 'director/command/arguments', - [ - 'argument_id' => $row->id, - 'name' => $this->command->getObjectName() - ] - ), + Link::create($row->argument_name, 'director/command/arguments', [ + 'argument_id' => $row->id, + 'name' => $this->command->getObjectName() + ]), $row->argument_value ]); } @@ -51,20 +47,15 @@ class IcingaCommandArgumentTable extends ZfQueryBasedTable ]; } - public function getColumns() - { - return array( - 'id' => 'ca.id', - 'argument_name' => "COALESCE(ca.argument_name, '(none)')", - 'argument_value' => 'ca.argument_value', - ); - } - public function prepareQuery() { return $this->db()->select()->from( ['ca' => 'icinga_command_argument'], - $this->getColumns() + [ + 'id' => 'ca.id', + 'argument_name' => "COALESCE(ca.argument_name, '(none)')", + 'argument_value' => 'ca.argument_value', + ] )->where( 'ca.command_id = ?', $this->command->get('id')