Documentation

CRM_Core_BAO_CustomQuery
in package

Tags
copyright

CiviCRM LLC https://civicrm.org/licensing

Table of Contents

Constants

PREFIX  = 'custom_value_'

Properties

$_element  : array<string|int, mixed>
The name of the elements that are in the select clause.
$_fields  : array<string|int, mixed>
The custom fields information.
$_qill  : array<string|int, mixed>
The english language version of the query.
$_select  : array<string|int, mixed>
The select clause.
$_tables  : array<string|int, mixed>
The tables involved in the query.
$_where  : array<string|int, mixed>
The where clause.
$_whereTables  : mixed
$extendsMap  : array<string|int, mixed>
This stores custom data group types and tables that it extends.
$_contactSearch  : bool
Searching for contacts?
$_ids  : array<string|int, mixed>
The set of custom field ids.
$_locationSpecificCustomFields  : mixed

Methods

__construct()  : mixed
Class constructor.
getFields()  : array<string|int, mixed>
query()  : array<string|int, mixed>
Function that does the actual query generation.
select()  : mixed
Generate the select clause and the associated tables.
where()  : mixed
Generate the where clause and also the english language equivalent.
joinCustomTableForField()  : mixed
Join the custom table for the field in (if not already in the query).

Constants

Properties

$_element

The name of the elements that are in the select clause.

public array<string|int, mixed> $_element

used to extract the values

$_fields

The custom fields information.

public array<string|int, mixed> $_fields

$_qill

The english language version of the query.

public array<string|int, mixed> $_qill

$_select

The select clause.

public array<string|int, mixed> $_select

$_tables

The tables involved in the query.

public array<string|int, mixed> $_tables

$_where

The where clause.

public array<string|int, mixed> $_where

$extendsMap

This stores custom data group types and tables that it extends.

public static array<string|int, mixed> $extendsMap = ['Contact' => 'civicrm_contact', 'Individual' => 'civicrm_contact', 'Household' => 'civicrm_contact', 'Organization' => 'civicrm_contact', 'Contribution' => 'civicrm_contribution', 'ContributionRecur' => 'civicrm_contribution_recur', 'Membership' => 'civicrm_membership', 'Participant' => 'civicrm_participant', 'Group' => 'civicrm_group', 'Relationship' => 'civicrm_relationship', 'Event' => 'civicrm_event', 'Case' => 'civicrm_case', 'Activity' => 'civicrm_activity', 'Pledge' => 'civicrm_pledge', 'Grant' => 'civicrm_grant', 'Address' => 'civicrm_address', 'Campaign' => 'civicrm_campaign', 'Survey' => 'civicrm_survey']

$_contactSearch

Searching for contacts?

protected bool $_contactSearch

$_ids

The set of custom field ids.

protected array<string|int, mixed> $_ids

$_locationSpecificCustomFields

protected mixed $_locationSpecificCustomFields

Methods

__construct()

Class constructor.

public __construct(array<string|int, mixed> $ids[, bool $contactSearch = FALSE ][, array<string|int, mixed> $locationSpecificFields = [] ]) : mixed

Takes in a set of custom field ids andsets up the data structures to generate a query

Parameters
$ids : array<string|int, mixed>

The set of custom field ids.

$contactSearch : bool = FALSE
$locationSpecificFields : array<string|int, mixed> = []

getFields()

public getFields() : array<string|int, mixed>
Return values
array<string|int, mixed>

query()

Function that does the actual query generation.

public query() : array<string|int, mixed>

basically ties all the above functions together

Return values
array<string|int, mixed>

array of strings

select()

Generate the select clause and the associated tables.

public select() : mixed

joinCustomTableForField()

Join the custom table for the field in (if not already in the query).

protected joinCustomTableForField(array<string|int, mixed> $field) : mixed
Parameters
$field : array<string|int, mixed>

        
On this page

Search results