Elgg  Version 6.1
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
Elgg\Database\River Class Reference

River repository contains methods for fetching/counting river items. More...

Inheritance diagram for Elgg\Database\River:
Elgg\Database\Repository

Public Member Functions

 __construct (array $options=[])
 {} More...
 
 count ()
 {} More...
 
 calculate ($function, $property, $property_type= 'annotation')
 Performs a mathematical calculation on river annotations. More...
 
 get ($limit=null, $offset=null, $callback=null)
 Fetch river items. More...
 
 execute ()
 Execute the query resolving calculation, count and/or batch options. More...
 
 buildEntityClauses ($qb)
 Add subject, object and target clauses Make sure all three are accessible by the user. More...
 
- Public Member Functions inherited from Elgg\Database\Repository
 __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 find (array $options=[])
 Build and execute a new query from an array of legacy options. More...
 
- Static Public Member Functions inherited from Elgg\Database\Repository
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 Member Functions

 buildQuery (QueryBuilder $qb)
 Build a database query. More...
 
 buildRiverClause (QueryBuilder $qb)
 Process river properties. More...
 
 buildPairedAnnotationClause (QueryBuilder $qb, $clauses, $boolean= 'AND')
 Process annotation name value pairs Joins the annotation table on entity guid in the entities table and applies annotation where clauses. More...
 
 buildPairedRelationshipClause (QueryBuilder $qb, $clauses, $boolean= 'AND')
 Process relationship pairs. More...
 

Additional Inherited Members

- Protected Attributes inherited from Elgg\Database\Repository
QueryOptions $options
 

Detailed Description

River repository contains methods for fetching/counting river items.

Definition at line 18 of file River.php.

Constructor & Destructor Documentation

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

{}

Definition at line 23 of file River.php.

Member Function Documentation

Elgg\Database\River::buildEntityClauses (   $qb)

Add subject, object and target clauses Make sure all three are accessible by the user.

Parameters
QueryBuilder$qbQuery builder
Returns
CompositeExpression|mixed|null|string

Definition at line 265 of file River.php.

Elgg\Database\River::buildPairedAnnotationClause ( QueryBuilder  $qb,
  $clauses,
  $boolean = 'AND' 
)
protected

Process annotation name value pairs Joins the annotation table on entity guid in the entities table and applies annotation where clauses.

Parameters
QueryBuilder$qbQuery builder
AnnotationWhereClause[]$clauses Where clauses
string$booleanMerge boolean
Returns
CompositeExpression|string

Definition at line 309 of file River.php.

Elgg\Database\River::buildPairedRelationshipClause ( QueryBuilder  $qb,
  $clauses,
  $boolean = 'AND' 
)
protected

Process relationship pairs.

Parameters
QueryBuilder$qbQuery builder
RelationshipWhereClause[]$clauses Where clauses
string$booleanMerge boolean
Returns
CompositeExpression|string

Definition at line 334 of file River.php.

Elgg\Database\River::buildQuery ( QueryBuilder  $qb)
protected

Build a database query.

Parameters
QueryBuilder$qbthe Elgg QueryBuilder
Returns
QueryBuilder

Definition at line 210 of file River.php.

Elgg\Database\River::buildRiverClause ( QueryBuilder  $qb)
protected

Process river properties.

Parameters
QueryBuilder$qbQuery builder
Returns
CompositeExpression|mixed|null|string

Definition at line 242 of file River.php.

Elgg\Database\River::calculate (   $function,
  $property,
  $property_type = 'annotation' 
)

Performs a mathematical calculation on river annotations.

Parameters
string$functionValid numeric function
string$propertyProperty name
string$property_type'annotation'
Returns
int|float
Exceptions
DomainException

Definition at line 98 of file River.php.

Elgg\Database\River::count ( )

{}

Definition at line 75 of file River.php.

Elgg\Database\River::execute ( )

Execute the query resolving calculation, count and/or batch options.

Returns
array|[]|[]|int|
Exceptions
LogicException

Definition at line 184 of file River.php.

static Elgg\Database\River::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 68 of file River.php.

Elgg\Database\River::get (   $limit = null,
  $offset = null,
  $callback = null 
)

Fetch river items.

Parameters
int$limitLimit
int$offsetOffset
callable$callbackCustom callback
Returns
[]

Definition at line 133 of file River.php.


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