icingaweb2-module-director/application/tables/IcingaEndpointTable.php

49 lines
1.1 KiB
PHP
Raw Normal View History

2015-06-01 17:26:09 +02:00
<?php
namespace Icinga\Module\Director\Tables;
use Icinga\Module\Director\Web\Table\QuickTable;
class IcingaEndpointTable extends QuickTable
{
public function getColumns()
{
return array(
2015-06-02 17:36:47 +02:00
'id' => 'e.id',
'endpoint' => 'e.object_name',
'address' => 'e.address',
'zone' => 'z.object_name',
2015-06-01 17:26:09 +02:00
);
}
protected function getActionUrl($row)
{
2015-07-02 14:31:35 +02:00
return $this->url('director/endpoint', array('name' => $row->endpoint));
2015-06-01 17:26:09 +02:00
}
public function getTitles()
{
$view = $this->view();
return array(
2015-06-02 17:36:47 +02:00
'endpoint' => $view->translate('Endpoint'),
'address' => $view->translate('Address'),
'zone' => $view->translate('Zone'),
2015-06-01 17:26:09 +02:00
);
}
public function getBaseQuery()
2015-06-01 17:26:09 +02:00
{
$db = $this->connection()->getConnection();
$query = $db->select()->from(
array('e' => 'icinga_endpoint'),
array()
2015-06-01 17:26:09 +02:00
)->joinLeft(
array('z' => 'icinga_zone'),
'e.zone_id = z.id',
array()
);
return $query;
2015-06-01 17:26:09 +02:00
}
}