Elgg  Version 3.0
Public Member Functions | List of all members
Elgg\Database\QueryExecuting Interface Reference

This interface defines methods for building fluent interactions with a database repository. More...

Inheritance diagram for Elgg\Database\QueryExecuting:
Elgg\Database\Repository Elgg\Database\Annotations Elgg\Database\Entities Elgg\Database\Metadata Elgg\Database\River

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...
 

Detailed Description

This interface defines methods for building fluent interactions with a database repository.

Definition at line 11 of file QueryExecuting.php.

Member Function Documentation

Elgg\Database\QueryExecuting::batch (   $limit = null,
  $offset = null,
  $callback = null 
)

Fetch rows as an ElggBatch.

Parameters
int$limitNumber of rows to fetch
int$offsetIndex of the first row
callable | false$callbackCallback function to run database rows through
Returns
ElggBatch

Implemented in Elgg\Database\Repository.

Elgg\Database\QueryExecuting::calculate (   $function,
  $property,
  $property_type = null 
)

Apply numeric calculation to a column.

Parameters
string$functionCalculation, e.g. max, min, avg
string$propertyProperty name
string$property_typeProperty type
Returns
int|float

Implemented in Elgg\Database\River, Elgg\Database\Entities, Elgg\Database\Metadata, and Elgg\Database\Annotations.

Elgg\Database\QueryExecuting::count ( )
Elgg\Database\QueryExecuting::execute ( )

Apply correct execution method based on calculation, count or other criteria.

Returns
mixed

Implemented in Elgg\Database\Entities, Elgg\Database\River, Elgg\Database\Annotations, and Elgg\Database\Metadata.

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.

Parameters
Closure$closureFilter
Returns
static
Elgg\Database\QueryExecuting::get (   $limit = null,
  $offset = null,
  $callback = null 
)

Fetch rows.

Parameters
int$limitNumber of rows to fetch
int$offsetIndex of the first row
callable | false$callbackCallback function to run database rows through
Returns
[]|false

Implemented in Elgg\Database\River, Elgg\Database\Metadata, Elgg\Database\Entities, and Elgg\Database\Annotations.

Elgg\Database\QueryExecuting::groupBy (   $expression)

Add GROUP BY.

Parameters
string$expressionGroup by
Returns
static

Implemented in Elgg\Database\Repository.

Elgg\Database\QueryExecuting::having (   $expression)

Add HAVING.

Parameters
string$expressionHaving
Returns
static

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.

Parameters
string$joined_tableName of the table (with or without dbprefix)
string$joined_aliasAlias of the joined table If not set, the alias will be assigned automatically
string$xBase column, e.g. 'n_table.entity_guid' This value is NOT a query parameter and will not be sanitized
string$comparisonComparison operator, e.g. '=', 'not like' etc
mixed$yComparison value(s)
string$typeType of the comparison value(s), e.g. ELGG_VALUE_STRING, ELGG_VALUE_INT
bool$case_sensitiveUse case senstivie comparison for string values
Returns
static

Implemented in Elgg\Database\Repository.

Elgg\Database\QueryExecuting::orderBy (   $expression,
  $direction 
)

Add ORDER BY.

Parameters
string$expressionColumn/calculation
string$directionDirection
Returns
static

Implemented in Elgg\Database\Repository.

Elgg\Database\QueryExecuting::select (   $expression)

Add SELECT.

Parameters
mixed$expressionSelect
Returns
static

Implemented in Elgg\Database\Repository.


The documentation for this interface was generated from the following file: