Elgg
Version 4.3
|
This interface defines methods for building fluent interactions with a database repository. More...
Public Member Functions | |
count () | |
Count rows. More... | |
calculate ($function, $property, $property_type=null) | |
Apply numeric calculation to a column. More... | |
get ($limit=null, $offset=null, $callback=null) | |
Fetch rows. More... | |
batch ($limit=null, $offset=null, $callback=null) | |
Fetch rows as an ElggBatch. More... | |
execute () | |
Apply correct execution method based on calculation, count or other criteria. More... | |
filter (Closure $closure) | |
Filter query prior to execution Callback function will receive QueryBuilder as the first argument and table alias as a second Callback function can either mutate the instance of the QueryBuilder or return a composition expression that will be appended to AND where statements. More... | |
select ($expression) | |
Add SELECT. More... | |
join ($joined_table, $joined_alias=null, $x=null, $comparison=null, $y=null, $type=null, $case_sensitive=null) | |
Add JOIN clause Join a database table on an $x to $y comparison. More... | |
groupBy ($expression) | |
Add GROUP BY. More... | |
having ($expression) | |
Add HAVING. More... | |
orderBy ($expression, $direction) | |
Add ORDER BY. More... | |
This interface defines methods for building fluent interactions with a database repository.
Definition at line 11 of file QueryExecuting.php.
Elgg\Database\QueryExecuting::batch | ( | $limit = null , |
|
$offset = null , |
|||
$callback = null |
|||
) |
Fetch rows as an ElggBatch.
int | $limit | Number of rows to fetch |
int | $offset | Index of the first row |
callable | false | $callback | Callback function to run database rows through |
Implemented in Elgg\Database\Repository.
Elgg\Database\QueryExecuting::calculate | ( | $function, | |
$property, | |||
$property_type = null |
|||
) |
Apply numeric calculation to a column.
string | $function | Calculation, e.g. max, min, avg |
string | $property | Property name |
string | $property_type | Property type |
Implemented in Elgg\Database\River, Elgg\Database\Entities, Elgg\Database\Annotations, Elgg\Database\Metadata, and Elgg\Database\Relationships.
Elgg\Database\QueryExecuting::count | ( | ) |
Count rows.
Implemented in Elgg\Database\Relationships, Elgg\Database\River, Elgg\Database\Entities, Elgg\Database\Annotations, and Elgg\Database\Metadata.
Elgg\Database\QueryExecuting::execute | ( | ) |
Apply correct execution method based on calculation, count or other criteria.
Implemented in Elgg\Database\Entities, Elgg\Database\River, Elgg\Database\Annotations, Elgg\Database\Metadata, and Elgg\Database\Relationships.
Elgg\Database\QueryExecuting::filter | ( | Closure | $closure | ) |
Filter query prior to execution Callback function will receive QueryBuilder as the first argument and table alias as a second Callback function can either mutate the instance of the QueryBuilder or return a composition expression that will be appended to AND where statements.
Closure | $closure | Filter |
Elgg\Database\QueryExecuting::get | ( | $limit = null , |
|
$offset = null , |
|||
$callback = null |
|||
) |
Fetch rows.
int | $limit | Number of rows to fetch |
int | $offset | Index of the first row |
callable | false | $callback | Callback function to run database rows through |
Implemented in Elgg\Database\River, Elgg\Database\Relationships, Elgg\Database\Metadata, Elgg\Database\Entities, and Elgg\Database\Annotations.
Elgg\Database\QueryExecuting::groupBy | ( | $expression | ) |
Add GROUP BY.
string | $expression | Group by |
Implemented in Elgg\Database\Repository.
Elgg\Database\QueryExecuting::having | ( | $expression | ) |
Add HAVING.
string | $expression | Having |
Implemented in Elgg\Database\Repository.
Elgg\Database\QueryExecuting::join | ( | $joined_table, | |
$joined_alias = null , |
|||
$x = null , |
|||
$comparison = null , |
|||
$y = null , |
|||
$type = null , |
|||
$case_sensitive = null |
|||
) |
Add JOIN clause Join a database table on an $x to $y comparison.
string | $joined_table | Name of the table (with or without dbprefix) |
string | $joined_alias | Alias of the joined table If not set, the alias will be assigned automatically |
string | $x | Base column, e.g. 'n_table.entity_guid' This value is NOT a query parameter and will not be sanitized |
string | $comparison | Comparison operator, e.g. '=', 'not like' etc |
mixed | $y | Comparison value(s) |
string | $type | Type of the comparison value(s), e.g. ELGG_VALUE_STRING, ELGG_VALUE_INT |
bool | $case_sensitive | Use case senstivie comparison for string values |
Implemented in Elgg\Database\Repository.
Elgg\Database\QueryExecuting::orderBy | ( | $expression, | |
$direction | |||
) |
Add ORDER BY.
string | $expression | Column/calculation |
string | $direction | Direction |
Implemented in Elgg\Database\Repository.
Elgg\Database\QueryExecuting::select | ( | $expression | ) |
Add SELECT.
mixed | $expression | Select |
Implemented in Elgg\Database\Repository.