mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-31 01:34:12 +02:00
DataField: Add data field table
This commit is contained in:
parent
33892f3298
commit
5bc0037b34
43
application/tables/DatafieldTable.php
Normal file
43
application/tables/DatafieldTable.php
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
<?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)
|
||||||
|
{
|
||||||
|
return $this->url('director/show/datafield', array('id' => $row->id));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getTitles()
|
||||||
|
{
|
||||||
|
$view = $this->view();
|
||||||
|
return array(
|
||||||
|
'varname' => $view->translate('Field name'),
|
||||||
|
'datatype' => $view->translate('Data type'),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function fetchData()
|
||||||
|
{
|
||||||
|
$db = $this->connection()->getConnection();
|
||||||
|
|
||||||
|
$query = $db->select()->from(
|
||||||
|
array('f' => 'director_datafield'),
|
||||||
|
$this->getColumns()
|
||||||
|
)->order('varname ASC');
|
||||||
|
|
||||||
|
return $db->fetchAll($query);
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user