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

Public Member Functions

 ensure_table ($table, $relationship=NULL, $join=NULL)
 
 init ($base_table='tripal_entity', $base_field='id', $options)
 
 add_field ($table_alias, $field_name, $alias='', $params=[])
 
 add_where ($group, $field_name, $value=NULL, $operator=NULL)
 
 add_where_expression ($group, $snippet, $args=[])
 
 add_orderby ($table, $field_name=NULL, $order='ASC', $alias='', $params=[])
 
 build (&$view)
 
 execute (&$view)
 
 placeholder ()
 
 add_relationship ($alias, $join, $base, $link_point=NULL)
 

Member Function Documentation

◆ add_orderby()

tripal_views_query::add_orderby (   $table,
  $field_name = NULL,
  $order = 'ASC',
  $alias = '',
  $params = [] 
)

Overrides add_orderby().

◆ add_relationship()

tripal_views_query::add_relationship (   $alias,
  $join,
  $base,
  $link_point = NULL 
)

This function copied from views_plugin_query_default::add_relationship

◆ add_where()

tripal_views_query::add_where (   $group,
  $field_name,
  $value = NULL,
  $operator = NULL 
)

Add a simple WHERE clause to the query.

Parameters
$groupThe WHERE group to add these to; groups are used to create AND/OR sections. Groups cannot be nested. Use 0 as the default group. If the group does not yet exist it will be created as an AND group.
$fieldThe name of the field to check.
$valueThe value to test the field against. In most cases, this is a scalar. For more complex options, it is an array. The meaning of each element in the array is dependent on the $operator.
$operatorThe comparison operator, such as =, <, or >=. It also accepts more complex options such as IN, LIKE, or BETWEEN. Defaults to IN if $value is an array = otherwise. If $field is a string you have to use 'formula' here.

◆ add_where_expression()

tripal_views_query::add_where_expression (   $group,
  $snippet,
  $args = [] 
)

Add's a where exression clause to a query.

Parameters
$groupThe WHERE group to add these to; groups are used to create AND/OR sections. Groups cannot be nested. Use 0 as the default group. If the group does not yet exist it will be created as an AND group.
$snippetThe snippet to check. This can be either a column or a complex expression like "UPPER(table.field) = 'value'".
$argsAn associative array of arguments.

◆ build()

tripal_views_query::build ( $view)

Overrides build().

◆ ensure_table()

tripal_views_query::ensure_table (   $table,
  $relationship = NULL,
  $join = NULL 
)

Ensure a table exists in the queue.

This function overrides the views_plugin_query version of the function but does nothing other than return the "table" (or bundle) name as we won't be using aliases for bundles.

Parameters
$tableThe unaliased name of the table to ensure.
$relationshipThe relationship to ensure the table links to. Each relationship will get a unique instance of the table being added. If not specified, will be the primary table.
$joinA views_join object (or derived object) to join the alias in.
Returns
The alias used to refer to this specific table, or NULL if the table cannot be ensured.

◆ execute()

tripal_views_query::execute ( $view)
Parameters
$view

◆ placeholder()

tripal_views_query::placeholder ( )

Provides a unique placeholders for handlers.


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