Elgg  Version 3.0
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
Elgg\Database\Repository Class Reference

Abstract methods for interfacing with the database. More...

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

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.
Parameters
int$limitNumber of rows to fetch
int$offsetIndex of the first row
callable | false$callbackCallback function to run database rows through
Returns
ElggBatch
} More...
 
 filter (\Closure $closure)
 {} More...
 
 select ($expression)
 {Add SELECT.
Parameters
mixed$expressionSelect
Returns
static
} 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.
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
} More...
 
 groupBy ($expression)
 {Add GROUP BY.
Parameters
string$expressionGroup by
Returns
static
} More...
 
 having ($expression)
 {Add HAVING.
Parameters
string$expressionHaving
Returns
static
} More...
 
 orderBy ($expression, $direction)
 {Add ORDER BY.
Parameters
string$expressionColumn/calculation
string$directionDirection
Returns
static
} More...
 
 expandInto (QueryBuilder $qb, $table_alias=null)
 Extend query builder with select, group_by, having and order_by clauses from $options. More...
 
- Public Member Functions inherited from Elgg\Database\QueryExecuting
 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
 

Detailed Description

Abstract methods for interfacing with the database.

Definition at line 15 of file Repository.php.

Constructor & Destructor Documentation

Elgg\Database\Repository::__construct ( array  $options = [])

Constructor.

Parameters
array$optionsege* options

Definition at line 27 of file Repository.php.

Member Function Documentation

Elgg\Database\Repository::__get (   $name)

{}

Definition at line 34 of file Repository.php.

Elgg\Database\Repository::__isset (   $name)

{}

Definition at line 61 of file Repository.php.

Elgg\Database\Repository::__set (   $name,
  $value 
)

{}

Definition at line 47 of file Repository.php.

Elgg\Database\Repository::__unset (   $name)

{}

Definition at line 54 of file Repository.php.

Elgg\Database\Repository::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
}

Implements Elgg\Database\QueryExecuting.

Definition at line 96 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.

Parameters
QueryBuilder$qbQuery builder
string$table_aliasTable alias
Returns
void

Definition at line 180 of file Repository.php.

Elgg\Database\Repository::filter ( \Closure  $closure)

{}

Definition at line 118 of file Repository.php.

static Elgg\Database\Repository::find ( array  $options = [])
static

Build and execute a new query from an array of legacy options.

Parameters
array$optionsOptions
Returns
[]|int|mixed

Definition at line 85 of file Repository.php.

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

{Add GROUP BY.

Parameters
string$expressionGroup by
Returns
static
}

Implements Elgg\Database\QueryExecuting.

Definition at line 148 of file Repository.php.

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

{Add HAVING.

Parameters
string$expressionHaving
Returns
static
}

Implements Elgg\Database\QueryExecuting.

Definition at line 157 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.

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
}

Implements Elgg\Database\QueryExecuting.

Definition at line 136 of file Repository.php.

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

{Add ORDER BY.

Parameters
string$expressionColumn/calculation
string$directionDirection
Returns
static
}

Implements Elgg\Database\QueryExecuting.

Definition at line 166 of file Repository.php.

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

{Add SELECT.

Parameters
mixed$expressionSelect
Returns
static
}

Implements Elgg\Database\QueryExecuting.

Definition at line 127 of file Repository.php.

static Elgg\Database\Repository::with ( array  $options = [])
static

Constructs a new.

Parameters
array$optionsege* options
Returns
static

Definition at line 72 of file Repository.php.

Member Data Documentation

Elgg\Database\Repository::$options
protected

Definition at line 20 of file Repository.php.


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