2015-07-03 10:48:50 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Icinga\Module\Director\Tables;
|
|
|
|
|
|
|
|
use Icinga\Module\Director\Web\Table\QuickTable;
|
|
|
|
|
|
|
|
class DatafieldTable extends QuickTable
|
|
|
|
{
|
|
|
|
public function getColumns()
|
|
|
|
{
|
|
|
|
return array(
|
|
|
|
'id' => 'f.id',
|
|
|
|
'varname' => 'f.varname',
|
|
|
|
'datatype' => 'f.datatype',
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
protected function getActionUrl($row)
|
|
|
|
{
|
2015-07-03 14:20:47 +02:00
|
|
|
return $this->url('director/datafield/edit', array('id' => $row->id));
|
2015-07-03 10:48:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public function getTitles()
|
|
|
|
{
|
|
|
|
$view = $this->view();
|
|
|
|
return array(
|
|
|
|
'varname' => $view->translate('Field name'),
|
|
|
|
'datatype' => $view->translate('Data type'),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2015-07-23 16:19:22 +02:00
|
|
|
public function getBaseQuery()
|
2015-07-03 10:48:50 +02:00
|
|
|
{
|
|
|
|
$db = $this->connection()->getConnection();
|
|
|
|
|
|
|
|
$query = $db->select()->from(
|
|
|
|
array('f' => 'director_datafield'),
|
2015-07-23 16:19:22 +02:00
|
|
|
array()
|
2015-07-03 10:48:50 +02:00
|
|
|
)->order('varname ASC');
|
|
|
|
|
2015-07-23 16:19:22 +02:00
|
|
|
return $query;
|
2015-07-03 10:48:50 +02:00
|
|
|
}
|
|
|
|
}
|