Skip to content

classes_lib_controls_table_databasetable.class

Daniel Spors edited this page Dec 19, 2023 · 3 revisions

Classes in file lib/controls/table/databasetable.class.php

class DatabaseTable

Allows to easily integrate database tables into UI.

Implements: ICallable

Extends: Table » Control » Renderable

Subclasses: uiDatabaseTable

AddFooter

Default AddFooter method Creates a table footer with the given keys as text. Uses Table::Footer() internally

Definition: public function AddFooter($keys)

Returns: void

Parameters:

AddHeader

Default AddHeader method Creates a table header with the given keys as text. Uses Table::Header() internally

Definition: public function AddHeader($keys)

Returns: void

Parameters:

AddRow

Default AddRow method This will be called for each row to add (from the execution routines). If you override this in derivered classes you can easily react on that. Uses Table::NewRow() internally

Definition: public function AddRow($data)

Returns: void

Parameters:

  • array $data Row as assaciative array

AssignOnAddFooter

Allows to assign your own handler to the AddFooter function Sometimes you do not want to inherit from this, but create a table and assign the handlers to another object.

Definition: public function AssignOnAddFooter($handler, $function)

Returns: static

Parameters:

  • object $handler Object containing the handler method

  • string $function Name of the handler method

AssignOnAddHeader

Allows to assign your own handler to the AddHeader function Sometimes you do not want to inherit from this, but create a table and assign the handlers to another object.

Definition: public function AssignOnAddHeader($handler, $function)

Returns: static

Parameters:

  • object $handler Object containing the handler method

  • string $function Name of the handler method

AssignOnAddRow

Allows to assign your own handler to the AddRow function Sometimes you do not want to inherit from this, but create a table and assign the handlers to another object.

Definition: public function AssignOnAddRow($handler, $function)

Returns: static

Parameters:

  • object $handler Object containing the handler method

  • string $function Name of the handler method

Clear

OVERRIDE Table::Clear

Export

INTERNAL Currently untested, so marked internal

GetData

INTERNAL Builds the SQL query and executed it

GetSQL

Returns the SQL statement used in this table.

Definition: public final function GetSQL()

Returns: string The SQL statement

LogIfSlow

Write a log information if querying was slow.

Definition: public function LogIfSlow($min_ms)

Returns: static

Parameters:

  • int $min_ms Minimum milliseconds that must be reached to really write info to log

OverrideExecuteSql

Allows to override the default execute method This will allow you to integrate your own execution handler

Definition: public function OverrideExecuteSql($handler, $function)

Returns: void

Parameters:

  • object $handler Object containing the handler method

  • string $function Name of handler method

PreRender

OVERRIDE Calls DatabaseTable::GetData() and loops thru the ResultSet creating the table content before calling Table::PreRender

_exportExcel

Definition: protected function _exportExcel($format=self, EXPORT_FORMAT_XLSX $rowcallback=null)

Returns: NOT DOCUMENTED

Parameters:

  • $format [default: self] NOT DOCUMENTED

  • $rowcallback [default: null] NOT DOCUMENTED

__construct

Definition: public function __construct($datasource, $datatype=false, $datatable=false)

Returns: NOT DOCUMENTED

Parameters:

  • \ScavixWDF\Model\DataSource $datasource DataSource to use

  • string $datatype Datatype to be rendered

  • string $datatable Data tyble to be rendered

Clone this wiki locally