Elgg
Version 4.3
|
Metadata repository contains methods for fetching metadata 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 metadata or metadata entity's properties. More... | ||||||||||||||||||||||
get ($limit=null, $offset=null, $callback=null) | ||||||||||||||||||||||
Fetch metadata. 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.
| ||||||||||||||||||||||
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... | |
buildEntityWhereClause (QueryBuilder $qb) | |
Process entity attribute wheres Joins entities table on entity guid in metadata table and applies where clauses. More... | |
buildPairedMetadataClause (QueryBuilder $qb, $clauses, $boolean= 'AND') | |
Process metadata name value pairs Applies where clauses to the selected metadata table. More... | |
buildPairedAnnotationClause (QueryBuilder $qb, $clauses, $boolean= 'AND') | |
Process annotation name value pairs Joins annotation table on entity_guid in the metadata table and applies where clauses. More... | |
buildPairedPrivateSettingsClause (QueryBuilder $qb, $clauses, $boolean= 'AND') | |
Process private settings name value pairs Joins private settings table on entity_guid in the metadata table and applies where clauses. More... | |
buildPairedRelationshipClause (QueryBuilder $qb, $clauses, $boolean= 'AND') | |
Process relationship name value pairs Joins relationship table on entity_guid in the metadata table and applies where clauses. 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 | |
Metadata repository contains methods for fetching metadata from database or performing calculations on entity properties.
Definition at line 21 of file Metadata.php.
|
protected |
Process entity attribute wheres Joins entities table on entity guid in metadata table and applies where clauses.
QueryBuilder | $qb | Query builder |
Definition at line 228 of file Metadata.php.
|
protected |
Process annotation name value pairs Joins annotation table on entity_guid in the metadata table and applies where clauses.
QueryBuilder | $qb | Query builder |
AnnotationWhereClause[] | $clauses Where clauses | |
string | $boolean | Merge boolean |
Definition at line 268 of file Metadata.php.
|
protected |
Process metadata name value pairs Applies where clauses to the selected metadata table.
QueryBuilder | $qb | Query builder |
MetadataWhereClause[] | $clauses Where clauses | |
string | $boolean | Merge boolean |
Definition at line 247 of file Metadata.php.
|
protected |
Process private settings name value pairs Joins private settings table on entity_guid in the metadata table and applies where clauses.
QueryBuilder | $qb | Query builder |
PrivateSettingWhereClause[] | $clauses Where clauses | |
string | $boolean | Merge boolean |
Definition at line 293 of file Metadata.php.
|
protected |
Process relationship name value pairs Joins relationship table on entity_guid in the metadata table and applies where clauses.
QueryBuilder | $qb | Query builder |
RelationshipWhereClause[] | $clauses Where clauses | |
string | $boolean | Merge boolean |
Definition at line 320 of file Metadata.php.
|
protected |
Build a database query.
QueryBuilder | $qb |
Definition at line 192 of file Metadata.php.
Elgg\Database\Metadata::calculate | ( | $function, | |
$property, | |||
$property_type = null |
|||
) |
Performs a mathematical calculation on metadata or metadata entity's properties.
string | $function | Valid numeric function |
string | $property | Property name |
string | $property_type | 'attribute'|'metadata'|'annotation'|'private_setting' |
InvalidParameterException |
Implements Elgg\Database\QueryExecuting.
Definition at line 53 of file Metadata.php.
Elgg\Database\Metadata::count | ( | ) |
{Count rows.
Implements Elgg\Database\QueryExecuting.
Definition at line 26 of file Metadata.php.
Elgg\Database\Metadata::execute | ( | ) |
Execute the query resolving calculation, count and/or batch options.
LogicException |
Implements Elgg\Database\QueryExecuting.
Definition at line 156 of file Metadata.php.
Elgg\Database\Metadata::get | ( | $limit = null , |
|
$offset = null , |
|||
$callback = null |
|||
) |
Fetch metadata.
int | $limit | Limit |
int | $offset | Offset |
callable | $callback | Custom callback |
Implements Elgg\Database\QueryExecuting.
Definition at line 117 of file Metadata.php.