From 5bc0037b34bb02a6e48ad9b722981501377b996a Mon Sep 17 00:00:00 2001 From: Alexander Fuhr Date: Fri, 3 Jul 2015 10:48:50 +0200 Subject: [PATCH] DataField: Add data field table --- application/tables/DatafieldTable.php | 43 +++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 application/tables/DatafieldTable.php diff --git a/application/tables/DatafieldTable.php b/application/tables/DatafieldTable.php new file mode 100644 index 00000000..f575624b --- /dev/null +++ b/application/tables/DatafieldTable.php @@ -0,0 +1,43 @@ + '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); + } +}