function hook_field_storage_tquery

3.x tripal.fields.api.inc hook_field_storage_tquery($conditions, $orderBy)

Executes a TripalFieldQuery using the provided conditions.

This hook is called to find the entities having certain field conditions and sort them in the given field order.

Parameters

$conditions: An array of filter representing the conditions to be applied to the query. Each filter is an associative array whose keys include the following:

  • field: an array representing the field identical to the output of the field_info_field() function.
  • filter: the name of the field on which the filter should be applied.
  • value: the value of the filter.
  • operator: the operation to apply: '=', '<>', '>', '>=', '<', '<=', 'STARTS_WITH', 'CONTAINS': These operators expect $value to be a literal of the same type as the column. 'IN', 'NOT IN': These operators expect $value to be an array of literals of the same type as the column.

$orderBy: An array of sorting instructions. Each sort is an associative array with the following keys:

  • field: an array representing the field identical to the output of the field_info_field() function.
  • orderBy: the name of the field on which the filter should be applied.
  • direction: either the string 'ASC' (for ascending sort) or 'DESC' (for descending).

Related topics

File

tripal/api/tripal.fields.api.inc, line 79
Provides an application programming interface (API) for working with fields attached to TripalEntity content types (bundles).

Code

function hook_field_storage_tquery($conditions, $orderBy) {
  // See the tripal_chado_field_storage_tquery() function for an example.
}