mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-30 17:24:18 +02:00
IcingaCommandArgumentTable: improve readability
This commit is contained in:
parent
d92492d5a1
commit
985d03d5f2
@ -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')
|
||||
|
Loading…
x
Reference in New Issue
Block a user