Tripal
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
TripalFieldQuery Class Reference
Inheritance diagram for TripalFieldQuery:
Inheritance graph
[legend]
Collaboration diagram for TripalFieldQuery:
Collaboration graph
[legend]

Public Member Functions

 addRelationship ($table, $alias, $field)
 
 relationshipCondition ($table, $field, $value, $op)
 
 execute ()
 
 queryCallback ()
 
 __toString ()
 

Public Attributes

 $relationships = []
 
 $relationshipConditions = []
 

Protected Member Functions

 _intersectResults ($current_results, $new_results)
 
 queryStorageCallback ($storage)
 

Protected Attributes

 $includes = []
 

Detailed Description

Extends the EntityFieldQuery to support queries from multiple storage types.

Member Function Documentation

◆ __toString()

TripalFieldQuery::__toString ( )

Allows query object to be dumped as a string.

◆ _intersectResults()

TripalFieldQuery::_intersectResults (   $current_results,
  $new_results 
)
protected

Generates an intersection of results from different storage back-ends.

◆ addRelationship()

TripalFieldQuery::addRelationship (   $table,
  $alias,
  $field 
)

Adds a relationship via a table join to the tripal_entity table

This is specific for Drupal schema tables and is useful for Views integration when non Tripal Storage API fields are attached to an entity.

Parameters
$tableThe name of the table to join.
$aliasThe alias for the table.
$fieldThe field to join on.

◆ execute()

TripalFieldQuery::execute ( )

Overrides the EntityFieldQuery::execute() function.

◆ queryCallback()

TripalFieldQuery::queryCallback ( )

Overrides the EntityFieldQuery::queryCallback function.

◆ queryStorageCallback()

TripalFieldQuery::queryStorageCallback (   $storage)
protected

Determines the query callback to use for this entity query.

This function is a replacement for queryCallback() from the parent EntityFieldQuery class because that class only allows a single storage type per query.

Parameters
$storageThe storage module
Exceptions
EntityFieldQueryException
Returns
A callback that can be used with call_user_func().

◆ relationshipCondition()

TripalFieldQuery::relationshipCondition (   $table,
  $field,
  $value,
  $op 
)

Adds a where statement to a relationship.

The relationship is added by the $table

Member Data Documentation

◆ $includes

TripalFieldQuery::$includes = []
protected

Holds a list of fields that should be included in the results

◆ $relationships

TripalFieldQuery::$relationships = []

These member variables keep track of join relationships with the tripal_entity table. This is useful for non Tripal Storage API fields that want to filter based on on other Drupal tables. The most important example for this would be Drupal Views. These variables are only meant to be used by the tripal_field_storage_query() function as that is the only storage system that should be doing queries on the tripal_entity table itself.


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