Elgg
Version 4.3
|
Relationships repository contains methods for fetching relationships from database or performing calculations on relationship properties. More...
Public Member Functions | ||||||||||||||||||||||
calculate ($function, $property, $property_type=null) | ||||||||||||||||||||||
Apply numeric calculation to a column.
| ||||||||||||||||||||||
count () | ||||||||||||||||||||||
Count rows.
| ||||||||||||||||||||||
execute () | ||||||||||||||||||||||
Apply correct execution method based on calculation, count or other criteria.
| ||||||||||||||||||||||
get ($limit=null, $offset=null, $callback=null) | ||||||||||||||||||||||
Fetch rows.
| ||||||||||||||||||||||
![]() | ||||||||||||||||||||||
__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... | ||||||||||||||||||||||
![]() | ||||||||||||||||||||||
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... | ||||||||||||||||||||||
Protected Member Functions | |
buildQuery (QueryBuilder $qb) | |
Build a database query. More... | |
buildEntityClause (QueryBuilder $qb) | |
Process entity attribute wheres Joins entities table on guid_one|guid_two in relationships table and applies where clauses. More... | |
buildPairedMetadataClause (QueryBuilder $qb, $clauses, $boolean= 'AND') | |
Process metadata name value pairs Joins the metadata table on guid_one|guid_two in relationships table and applies metadata where clauses. More... | |
buildPairedAnnotationClause (QueryBuilder $qb, $clauses, $boolean= 'AND') | |
Process annotation name value pairs Joins the annotation table on guid_one|guid_two in relationships table and applies annotation where clauses. More... | |
buildPairedPrivateSettingsClause (QueryBuilder $qb, $clauses, $boolean= 'AND') | |
Process private setting name value pairs Joins the private settings table on guid_one|guid_two in relationships table and applies private setting where clauses. More... | |
buildPairedRelationshipClause (QueryBuilder $qb, $clauses, $boolean= 'AND') | |
Process relationship pairs. More... | |
getJoinColumn () | |
Return the base column to use in joins. More... | |
Additional Inherited Members | |
![]() | |
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... | |
![]() | |
$options | |
Relationships repository contains methods for fetching relationships from database or performing calculations on relationship properties.
Definition at line 22 of file Relationships.php.
|
protected |
Process entity attribute wheres Joins entities table on guid_one|guid_two in relationships table and applies where clauses.
QueryBuilder | $qb | Query builder |
Definition at line 225 of file Relationships.php.
|
protected |
Process annotation name value pairs Joins the annotation table on guid_one|guid_two in relationships table and applies annotation where clauses.
QueryBuilder | $qb | Query builder |
AnnotationWhereClause[] | $clauses Where clauses | |
string | $boolean | Merge boolean |
Definition at line 269 of file Relationships.php.
|
protected |
Process metadata name value pairs Joins the metadata table on guid_one|guid_two in relationships table and applies metadata where clauses.
QueryBuilder | $qb | Query builder |
MetadataWhereClause[] | $clauses Where clauses | |
string | $boolean | Merge boolean |
Definition at line 240 of file Relationships.php.
|
protected |
Process private setting name value pairs Joins the private settings table on guid_one|guid_two in relationships table and applies private setting where clauses.
QueryBuilder | $qb | Query builder |
PrivateSettingWhereClause[] | $clauses Where clauses | |
string | $boolean | Merge boolean |
Definition at line 296 of file Relationships.php.
|
protected |
Process relationship pairs.
QueryBuilder | $qb | Query builder |
RelationshipWhereClause[] | $clauses Where clauses | |
string | $boolean | Merge boolean |
Definition at line 322 of file Relationships.php.
|
protected |
Build a database query.
QueryBuilder | $qb | Querybuilder with relationship params |
Definition at line 191 of file Relationships.php.
Elgg\Database\Relationships::calculate | ( | $function, | |
$property, | |||
$property_type = null |
|||
) |
Apply numeric calculation to a column.
string | $function | Calculation, e.g. max, min, avg |
string | $property | Property name |
string | $property_type | Property type |
InvalidParameterException; |
Implements Elgg\Database\QueryExecuting.
Definition at line 28 of file Relationships.php.
Elgg\Database\Relationships::count | ( | ) |
Count rows.
Implements Elgg\Database\QueryExecuting.
Definition at line 89 of file Relationships.php.
Elgg\Database\Relationships::execute | ( | ) |
Apply correct execution method based on calculation, count or other criteria.
Implements Elgg\Database\QueryExecuting.
Definition at line 108 of file Relationships.php.
Elgg\Database\Relationships::get | ( | $limit = null , |
|
$offset = null , |
|||
$callback = null |
|||
) |
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 |
Implements Elgg\Database\QueryExecuting.
Definition at line 140 of file Relationships.php.
|
protected |
Return the base column to use in joins.
Definition at line 337 of file Relationships.php.