Elgg
Version 6.2
|
Entities repository contains methods for fetching entities from database or performing calculations on entity properties. More...
Public Member Functions | |
count () | |
{Count rows.
| |
calculate ($function, $property, $property_type=null) | |
Performs a mathematical calculation on a set of entity properties. More... | |
get ($limit=null, $offset=null, $callback=null) | |
Fetch entities. More... | |
getDates () | |
Returns a list of months in which entities were updated or created. More... | |
execute () | |
Execute the query resolving calculation, count and/or batch options. More... | |
![]() | |
__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. 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... | |
Protected Member Functions | |
buildQuery (QueryBuilder $qb) | |
Build a database query. More... | |
buildEntityClause (QueryBuilder $qb) | |
Process entity attribute wheres Applies entity attribute constrains on the selected entities table. More... | |
buildPairedMetadataClause (QueryBuilder $qb, $clauses, $boolean='AND') | |
Process metadata name value pairs Joins the metadata table on entity guid in the entities table and applies metadata where clauses. 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 | |
![]() | |
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... | |
![]() | |
QueryOptions | $options |
Entities repository contains methods for fetching entities from database or performing calculations on entity properties.
Definition at line 19 of file Entities.php.
|
protected |
Process entity attribute wheres Applies entity attribute constrains on the selected entities table.
QueryBuilder | $qb | Query builder |
Definition at line 249 of file Entities.php.
|
protected |
Process annotation name value pairs Joins the annotation table on entity guid in the entities table and applies annotation where clauses.
QueryBuilder | $qb | Query builder |
AnnotationWhereClause[] | $clauses | Where clauses |
string | $boolean | Merge boolean |
Definition at line 291 of file Entities.php.
|
protected |
Process metadata name value pairs Joins the metadata table on entity guid in the entities table and applies metadata where clauses.
QueryBuilder | $qb | Query builder |
MetadataWhereClause[] | $clauses | Where clauses |
string | $boolean | Merge boolean |
Definition at line 263 of file Entities.php.
|
protected |
Process relationship pairs.
QueryBuilder | $qb | Query builder |
RelationshipWhereClause[] | $clauses | Where clauses |
string | $boolean | Merge boolean |
Definition at line 316 of file Entities.php.
|
protected |
Build a database query.
QueryBuilder | $qb | the Elgg QueryBuilder |
Definition at line 215 of file Entities.php.
Elgg\Database\Entities::calculate | ( | $function, | |
$property, | |||
$property_type = null |
|||
) |
Performs a mathematical calculation on a set of entity properties.
string | $function | Valid numeric function |
string | $property | Property name |
string | $property_type | 'attribute'|'metadata'|'annotation' |
DomainException |
Reimplemented from Elgg\Database\Repository.
Definition at line 51 of file Entities.php.
Elgg\Database\Entities::count | ( | ) |
{Count rows.
Reimplemented from Elgg\Database\Repository.
Definition at line 24 of file Entities.php.
Elgg\Database\Entities::execute | ( | ) |
Execute the query resolving calculation, count and/or batch options.
LogicException |
Reimplemented from Elgg\Database\Repository.
Definition at line 180 of file Entities.php.
Elgg\Database\Entities::get | ( | $limit = null , |
|
$offset = null , |
|||
$callback = null |
|||
) |
Fetch entities.
int | $limit | Limit |
int | $offset | Offset |
callable | $callback | Custom callback |
Reimplemented from Elgg\Database\Repository.
Definition at line 103 of file Entities.php.
Elgg\Database\Entities::getDates | ( | ) |
Returns a list of months in which entities were updated or created.
@tip Use this to generate a list of archives by month for when entities were added or updated.
Definition at line 149 of file Entities.php.