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

Public Member Functions

 __construct ($from, $usageidcolumn, $where= '', $params=array())
 from_question_attempts ($alias)
 where ()
 from_where_params ()
 usage_id_in ()
 usage_id_in_params ()

Data Fields

 $from
 $usageidcolumn
 $where
 $params

Detailed Description

This class represents a restriction on the set of question_usage ids to include in a larger database query based on JOINing to some other tables.

The general form of the query is something like

SELECT qa.id, qa.maxmark FROM $from JOIN {question_attempts} qa ON qa.questionusageid = $usageidcolumn WHERE $where AND qa.slot = 1

where $from, $usageidcolumn and $where are the arguments to the constructor.

Definition at line 1434 of file datalib.php.


Constructor & Destructor Documentation

__construct ( from,
usageidcolumn,
where = '',
params = array() 
)

Constructor. The meaning of the arguments is explained in the class comment.

Parameters:
string$fromSQL fragemnt to go in the FROM clause.
string$usageidcolumnthe column in $from that should be made equal to the usageid column in the JOIN clause.
string$whereSQL fragment to go in the where clause.
array$paramsrequired by the SQL. You must use named parameters.

Definition at line 1448 of file datalib.php.

Here is the call graph for this function:


Member Function Documentation

from_question_attempts ( alias)
Returns:
string the SQL that needs to go in the FROM clause when trying to select records from the 'question_attempts' table based on the qubaid_condition.

Reimplemented from qubaid_condition.

Definition at line 1458 of file datalib.php.

Returns:
the params needed by a query that uses from_question_attempts() and where().

Reimplemented from qubaid_condition.

Definition at line 1468 of file datalib.php.

Returns:
string SQL that can use used in a WHERE qubaid IN (...) query. This method returns the "IN (...)" part.

Reimplemented from qubaid_condition.

Definition at line 1472 of file datalib.php.

Returns:
the params needed by a query that uses usage_id_in().

Reimplemented from qubaid_condition.

Definition at line 1476 of file datalib.php.

where ( )
Returns:
string the SQL that needs to go in the where clause.

Reimplemented from qubaid_condition.

Definition at line 1464 of file datalib.php.

Here is the caller graph for this function:


Field Documentation

$from

Definition at line 1435 of file datalib.php.

$params

Definition at line 1438 of file datalib.php.

$usageidcolumn

Definition at line 1436 of file datalib.php.

Definition at line 1437 of file datalib.php.


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