Moodle  2.2.1
http://www.collinsharper.com
table_sql Class Reference
Inheritance diagram for table_sql:
Collaboration diagram for table_sql:

Public Member Functions

 __construct ($uniqueid)
 table_sql ($uniqueid)
 build_table ()
 get_row_class ($row)
 set_count_sql ($sql, array $params=NULL)
 set_sql ($fields, $from, $where, array $params=NULL)
 query_db ($pagesize, $useinitialsbar=true)
 out ($pagesize, $useinitialsbar, $downloadhelpbutton='')

Data Fields

 $countsql = NULL
 $countparams = NULL
 $sql = NULL
 $rawdata = NULL
 $is_sortable = true
 $is_collapsible = true

Detailed Description

Definition at line 1240 of file tablelib.php.


Constructor & Destructor Documentation

__construct ( uniqueid)
Parameters:
string$uniqueida string identifying this table.Used as a key in session vars.

Reimplemented from flexible_table.

Definition at line 1266 of file tablelib.php.

Here is the call graph for this function:

Here is the caller graph for this function:


Member Function Documentation

Take the data returned from the db_query and go through all the rows processing each col using either col_{columnname} method or other_cols method or if other_cols returns NULL then put the data straight into the table.

Reimplemented in quiz_report_overview_table, and quiz_report_responses_table.

Definition at line 1290 of file tablelib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

get_row_class ( row)

Get any extra classes names to add to this row in the HTML.

Parameters:
$rowarray the data for this row.
Returns:
string added to the class="" attribute of the tr.

Reimplemented in xhprof_table_sql, and quiz_attempt_report_table.

Definition at line 1305 of file tablelib.php.

Here is the caller graph for this function:

out ( pagesize,
useinitialsbar,
downloadhelpbutton = '' 
)

Convenience method to call a number of methods for you to display the table.

Definition at line 1394 of file tablelib.php.

Here is the call graph for this function:

query_db ( pagesize,
useinitialsbar = true 
)

Query the db. Store results in the table object for use by build_table.

Parameters:
int$pagesizesize of page for paginated displayed table.
bool$useinitialsbardo you want to use the initials bar. Bar will only be used if there is a fullname column defined for the table.

Reimplemented in quiz_attempt_report_table, and quiz_report_overview_table.

Definition at line 1344 of file tablelib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

set_count_sql ( sql,
array params = NULL 
)

This is only needed if you want to use different sql to count rows. Used for example when perhaps all db JOINS are not needed when counting records. You don't need to call this function the count_sql will be generated automatically.

We need to count rows returned by the db seperately to the query itself as we need to know how many pages of data we have to display.

Definition at line 1318 of file tablelib.php.

set_sql ( fields,
from,
where,
array params = NULL 
)

Set the sql to query the db. Query will be : SELECT $fields FROM $from WHERE $where Of course you can use sub-queries, JOINS etc. by putting them in the appropriate clause of the query.

Definition at line 1329 of file tablelib.php.

table_sql ( uniqueid)

Backwards-compatible constructor, so that legacy code subclassing table_sql does not break.

Deprecated:
since Moodle 2.0. Will be removed in Moodle 2.1.

Definition at line 1278 of file tablelib.php.

Here is the call graph for this function:


Field Documentation

$countparams = NULL

Definition at line 1243 of file tablelib.php.

$countsql = NULL

Definition at line 1242 of file tablelib.php.

$is_collapsible = true

Reimplemented from flexible_table.

Definition at line 1260 of file tablelib.php.

Reimplemented from flexible_table.

Definition at line 1256 of file tablelib.php.

$rawdata = NULL

Definition at line 1251 of file tablelib.php.

$sql = NULL

Definition at line 1247 of file tablelib.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations