Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
|
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. More...
Public Member Functions | |
__construct ($from, $usageidcolumn, $where='', $params=array()) | |
Constructor. | |
from_question_attempts ($alias) | |
Get the SQL fragment to go in a FROM clause. | |
from_where_params () | |
get_hash_code () | |
usage_id_in () | |
usage_id_in_params () | |
where () | |
Public Attributes | |
$from | |
$params | |
$usageidcolumn | |
$where | |
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.
qubaid_join::__construct | ( | $from, | |
$usageidcolumn, | |||
$where = '', | |||
$params = array() ) |
Constructor.
The meaning of the arguments is explained in the class comment.
string | $from | SQL fragemnt to go in the FROM clause. |
string | $usageidcolumn | the column in $from that should be made equal to the usageid column in the JOIN clause. |
string | $where | SQL fragment to go in the where clause. |
array | $params | required by the SQL. You must use named parameters. |
Reimplemented in mod_quiz\question\qubaids_for_users_attempts.
qubaid_join::from_question_attempts | ( | $alias | ) |
Get the SQL fragment to go in a FROM clause.
The SQL that needs to go in the FROM clause when trying to select records from the 'question_attempts' table based on this qubaid_condition.
string | $alias |
string | SQL fragment. |
Reimplemented from qubaid_condition.
qubaid_join::from_where_params | ( | ) |
array | the params needed by a query that uses from_question_attempts() and where(). |
Reimplemented from qubaid_condition.
|
inherited |
string | 40-character hash code that uniquely identifies the combination of properties and class name of this qubaid condition. |
qubaid_join::usage_id_in | ( | ) |
string | SQL that can use used in a WHERE qubaid IN (...) query. This method returns the "IN (...)" part. |
Reimplemented from qubaid_condition.
qubaid_join::usage_id_in_params | ( | ) |
array | the params needed by a query that uses usage_id_in(). |
Reimplemented from qubaid_condition.
qubaid_join::where | ( | ) |
string | the SQL that needs to go in the where clause. |
Reimplemented from qubaid_condition.