Metadata repository contains methods for fetching metadata from database or performing calculations on entity properties.  
 More...
 | 
|   | count () | 
|   | {Count rows.- Returns
 - int
  
}  More...
  | 
|   | 
|   | 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.  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...
  | 
|   | 
Metadata repository contains methods for fetching metadata from database or performing calculations on entity properties. 
Definition at line 19 of file Metadata.php.
 
◆ buildEntityWhereClause()
  
  
      
        
          | Elgg\Database\Metadata::buildEntityWhereClause  | 
          ( | 
          QueryBuilder  | 
          $qb | ) | 
           | 
         
       
   | 
  
protected   | 
  
 
Process entity attribute wheres Joins entities table on entity guid in metadata table and applies where clauses. 
- Parameters
 - 
  
  
 
- Returns
 - \Closure|CompositeExpression|mixed|null|string 
 
Definition at line 210 of file Metadata.php.
 
 
◆ buildPairedAnnotationClause()
  
  
      
        
          | Elgg\Database\Metadata::buildPairedAnnotationClause  | 
          ( | 
          QueryBuilder  | 
          $qb,  | 
         
        
           | 
           | 
            | 
          $clauses,  | 
         
        
           | 
           | 
            | 
          $boolean = 'AND'  | 
         
        
           | 
          ) | 
           |  | 
         
       
   | 
  
protected   | 
  
 
Process annotation name value pairs Joins annotation table on entity_guid in the metadata table and applies where clauses. 
- Parameters
 - 
  
    | QueryBuilder | $qb | Query builder  | 
    | AnnotationWhereClause[] | $clauses | Where clauses  | 
    | string | $boolean | Merge boolean | 
  
   
- Returns
 - CompositeExpression|string 
 
Definition at line 247 of file Metadata.php.
 
 
◆ buildPairedMetadataClause()
  
  
      
        
          | Elgg\Database\Metadata::buildPairedMetadataClause  | 
          ( | 
          QueryBuilder  | 
          $qb,  | 
         
        
           | 
           | 
            | 
          $clauses,  | 
         
        
           | 
           | 
            | 
          $boolean = 'AND'  | 
         
        
           | 
          ) | 
           |  | 
         
       
   | 
  
protected   | 
  
 
Process metadata name value pairs Applies where clauses to the selected metadata table. 
- Parameters
 - 
  
    | QueryBuilder | $qb | Query builder  | 
    | MetadataWhereClause[] | $clauses | Where clauses  | 
    | string | $boolean | Merge boolean | 
  
   
- Returns
 - CompositeExpression|string 
 
Definition at line 227 of file Metadata.php.
 
 
◆ buildPairedRelationshipClause()
  
  
      
        
          | Elgg\Database\Metadata::buildPairedRelationshipClause  | 
          ( | 
          QueryBuilder  | 
          $qb,  | 
         
        
           | 
           | 
            | 
          $clauses,  | 
         
        
           | 
           | 
            | 
          $boolean = 'AND'  | 
         
        
           | 
          ) | 
           |  | 
         
       
   | 
  
protected   | 
  
 
Process relationship name value pairs Joins relationship table on entity_guid in the metadata table and applies where clauses. 
- Note
 - Note that $relationship_join_on does not apply here, as there is only one guid column in the metadata table
 
- Parameters
 - 
  
    | QueryBuilder | $qb | Query builder  | 
    | RelationshipWhereClause[] | $clauses | Where clauses  | 
    | string | $boolean | Merge boolean | 
  
   
- Returns
 - CompositeExpression|string 
 
Definition at line 275 of file Metadata.php.
 
 
◆ buildQuery()
◆ calculate()
      
        
          | Elgg\Database\Metadata::calculate  | 
          ( | 
            | 
          $function,  | 
        
        
           | 
           | 
            | 
          $property,  | 
        
        
           | 
           | 
            | 
          $property_type = null  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Performs a mathematical calculation on metadata or metadata entity's properties. 
- Parameters
 - 
  
    | string | $function | Valid numeric function  | 
    | string | $property | Property name  | 
    | string | $property_type | 'attribute'|'metadata'|'annotation' | 
  
   
- Returns
 - int|float 
 
- Exceptions
 - 
  
  
 
Reimplemented from Elgg\Database\Repository.
Definition at line 51 of file Metadata.php.
 
 
◆ count()
      
        
          | Elgg\Database\Metadata::count  | 
          ( | 
           | ) | 
           | 
        
      
 
 
◆ execute()
      
        
          | Elgg\Database\Metadata::execute  | 
          ( | 
           | ) | 
           | 
        
      
 
Execute the query resolving calculation, count and/or batch options. 
- Returns
 - array|\ElggData[]|\ElggMetadata[]|int|\ElggBatch 
 
- Exceptions
 - 
  
  
 
Reimplemented from Elgg\Database\Repository.
Definition at line 141 of file Metadata.php.
 
 
◆ get()
      
        
          | Elgg\Database\Metadata::get  | 
          ( | 
            | 
          $limit = null,  | 
        
        
           | 
           | 
            | 
          $offset = null,  | 
        
        
           | 
           | 
            | 
          $callback = null  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Fetch metadata. 
- Parameters
 - 
  
    | int | $limit | Limit  | 
    | int | $offset | Offset  | 
    | callable | $callback | Custom callback | 
  
   
- Returns
 - \ElggMetadata[] 
 
Reimplemented from Elgg\Database\Repository.
Definition at line 103 of file Metadata.php.
 
 
The documentation for this class was generated from the following file: