Elgg
Version 6.2
|
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... | |
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, $join_column=null, $comparison=null, $values=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... | |
expandInto (QueryBuilder $qb, $table_alias=null) | |
Extend query builder with select, group_by, having and order_by clauses from $options. 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 | |
QueryOptions | $options |
Abstract methods for interfacing with the database.
Definition at line 16 of file Repository.php.
Elgg\Database\Repository::__construct | ( | array | $options = [] | ) |
Constructor.
array | $options | ege* options |
Reimplemented in Elgg\Database\River.
Definition at line 25 of file Repository.php.
Elgg\Database\Repository::__get | ( | $name | ) |
{}
Definition at line 32 of file Repository.php.
Elgg\Database\Repository::__isset | ( | $name | ) |
{}
Definition at line 59 of file Repository.php.
Elgg\Database\Repository::__set | ( | $name, | |
$value | |||
) |
{}
Definition at line 45 of file Repository.php.
Elgg\Database\Repository::__unset | ( | $name | ) |
{}
Definition at line 52 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 |
Definition at line 123 of file Repository.php.
|
abstract |
Apply numeric calculation to a column.
string | $function | Calculation, e.g. max, min, avg |
string | $property | Property name |
string | $property_type | Property type |
Reimplemented in Elgg\Database\Relationships, Elgg\Database\Metadata, Elgg\Database\Entities, Elgg\Database\Annotations, and Elgg\Database\River.
|
abstract |
Count rows.
Reimplemented in Elgg\Database\River, Elgg\Database\Relationships, Elgg\Database\Metadata, Elgg\Database\Entities, and Elgg\Database\Annotations.
|
abstract |
Apply correct execution method based on calculation, count or other criteria.
Reimplemented in Elgg\Database\River, Elgg\Database\Relationships, Elgg\Database\Metadata, Elgg\Database\Entities, and Elgg\Database\Annotations.
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 250 of file Repository.php.
Elgg\Database\Repository::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 |
Definition at line 158 of file Repository.php.
|
static |
Build and execute a new query from an array of legacy options.
array | $options | Options |
Reimplemented in Elgg\Database\River.
Definition at line 110 of file Repository.php.
|
abstract |
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 |
Reimplemented in Elgg\Database\River, Elgg\Database\Relationships, Elgg\Database\Metadata, Elgg\Database\Entities, and Elgg\Database\Annotations.
Elgg\Database\Repository::groupBy | ( | $expression | ) |
Add GROUP BY.
string | $expression | Group by |
Definition at line 209 of file Repository.php.
Elgg\Database\Repository::having | ( | $expression | ) |
Add HAVING.
string | $expression | Having |
Definition at line 222 of file Repository.php.
Elgg\Database\Repository::join | ( | $joined_table, | |
$joined_alias = null , |
|||
$join_column = null , |
|||
$comparison = null , |
|||
$values = 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 | $join_column | 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 | $values | Comparison value(s) |
string | $type | Type of the comparison value(s), e.g. ELGG_VALUE_STRING, ELGG_VALUE_INT |
bool | $case_sensitive | Use case sensitive comparison for string values |
Definition at line 193 of file Repository.php.
Elgg\Database\Repository::orderBy | ( | $expression, | |
$direction | |||
) |
Add ORDER BY.
string | $expression | Column/calculation |
string | $direction | Direction |
Definition at line 236 of file Repository.php.
Elgg\Database\Repository::select | ( | $expression | ) |
Add SELECT.
mixed | $expression | Select |
Definition at line 171 of file Repository.php.
|
static |
Constructs a new.
array | $options | ege* options |
Definition at line 70 of file Repository.php.
|
protected |
Definition at line 18 of file Repository.php.