Elgg
Version 4.3
|
Abstract methods for interfacing with the database. More...
Public Member Functions | ||||||||||||||||||||||
__construct (array $options=[]) | ||||||||||||||||||||||
Constructor. More... | ||||||||||||||||||||||
__get ($name) | ||||||||||||||||||||||
{} More... | ||||||||||||||||||||||
__set ($name, $value) | ||||||||||||||||||||||
{} More... | ||||||||||||||||||||||
__unset ($name) | ||||||||||||||||||||||
{} More... | ||||||||||||||||||||||
__isset ($name) | ||||||||||||||||||||||
{} More... | ||||||||||||||||||||||
batch ($limit=null, $offset=null, $callback=null) | ||||||||||||||||||||||
{Fetch rows as an ElggBatch.
| ||||||||||||||||||||||
filter (\Closure $closure) | ||||||||||||||||||||||
{} More... | ||||||||||||||||||||||
select ($expression) | ||||||||||||||||||||||
{Add SELECT.
| ||||||||||||||||||||||
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.
| ||||||||||||||||||||||
groupBy ($expression) | ||||||||||||||||||||||
{Add GROUP BY.
| ||||||||||||||||||||||
having ($expression) | ||||||||||||||||||||||
{Add HAVING.
| ||||||||||||||||||||||
orderBy ($expression, $direction) | ||||||||||||||||||||||
{Add ORDER BY.
| ||||||||||||||||||||||
expandInto (QueryBuilder $qb, $table_alias=null) | ||||||||||||||||||||||
Extend query builder with select, group_by, having and order_by clauses from $options. More... | ||||||||||||||||||||||
![]() | ||||||||||||||||||||||
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... | ||||||||||||||||||||||
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... | ||||||||||||||||||||||
Static Public Member Functions | |
static | with (array $options=[]) |
Constructs a new. More... | |
static | find (array $options=[]) |
Build and execute a new query from an array of legacy options. More... | |
Protected Attributes | |
$options | |
Abstract methods for interfacing with the database.
Definition at line 16 of file Repository.php.
Elgg\Database\Repository::__construct | ( | array | $options = [] | ) |
Elgg\Database\Repository::__get | ( | $name | ) |
{}
Definition at line 35 of file Repository.php.
Elgg\Database\Repository::__isset | ( | $name | ) |
{}
Definition at line 62 of file Repository.php.
Elgg\Database\Repository::__set | ( | $name, | |
$value | |||
) |
{}
Definition at line 48 of file Repository.php.
Elgg\Database\Repository::__unset | ( | $name | ) |
{}
Definition at line 55 of file Repository.php.
Elgg\Database\Repository::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 |
Implements Elgg\Database\QueryExecuting.
Definition at line 97 of file Repository.php.
Elgg\Database\Repository::expandInto | ( | QueryBuilder | $qb, |
$table_alias = null |
|||
) |
Extend query builder with select, group_by, having and order_by clauses from $options.
QueryBuilder | $qb | Query builder |
string | $table_alias | Table alias |
Definition at line 181 of file Repository.php.
Elgg\Database\Repository::filter | ( | \Closure | $closure | ) |
{}
Definition at line 119 of file Repository.php.
|
static |
Build and execute a new query from an array of legacy options.
array | $options | Options |
Definition at line 86 of file Repository.php.
Elgg\Database\Repository::groupBy | ( | $expression | ) |
{Add GROUP BY.
string | $expression | Group by |
Implements Elgg\Database\QueryExecuting.
Definition at line 149 of file Repository.php.
Elgg\Database\Repository::having | ( | $expression | ) |
{Add HAVING.
string | $expression | Having |
Implements Elgg\Database\QueryExecuting.
Definition at line 158 of file Repository.php.
Elgg\Database\Repository::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 |
Implements Elgg\Database\QueryExecuting.
Definition at line 137 of file Repository.php.
Elgg\Database\Repository::orderBy | ( | $expression, | |
$direction | |||
) |
{Add ORDER BY.
string | $expression | Column/calculation |
string | $direction | Direction |
Implements Elgg\Database\QueryExecuting.
Definition at line 167 of file Repository.php.
Elgg\Database\Repository::select | ( | $expression | ) |
{Add SELECT.
mixed | $expression | Select |
Implements Elgg\Database\QueryExecuting.
Definition at line 128 of file Repository.php.
|
static |
Constructs a new.
array | $options | ege* options |
Definition at line 73 of file Repository.php.
|
protected |
Definition at line 21 of file Repository.php.