Documentation

CRM_Contribute_BAO_Query extends CRM_Core_BAO_Query
in package

Tags
copyright

CiviCRM LLC https://civicrm.org/licensing

Table of Contents

Properties

$_contribOrSoftCredit  : mixed
$_contribRecurPayment  : mixed

Methods

addCustomFormFields()  : mixed
buildDateWhere()  : bool
Add the where for dates.
buildSearchForm()  : mixed
Add all the elements shared between contribute search and advanced search.
defaultReturnProperties()  : array<string|int, mixed>|null
Function you should avoid.
from()  : null|string
Get from clause.
getFields()  : array<string|int, mixed>
Function get the searchable fields for contribution.
getSearchFieldMetadata()  : mixed
Get the metadata for fields to be included on the search form.
initializeAnySoftCreditClause()  : mixed
Initialise the soft credit clause.
isSiteHasProducts()  : bool
Do any products exist in this site's database.
isSoftCreditOptionEnabled()  : bool
Check if soft credits are enables.
qill()  : string
Getter for the qill object.
searchAction()  : mixed
Possibly unnecessary function.
select()  : mixed
If contributions are involved, add the specific contribute fields.
selectorReturnProperties()  : array<string|int, mixed>
Get the list of fields required to populate the selector.
softCreditReturnProperties()  : array<string|int, mixed>
Get return properties for soft credits.
tableNames()  : mixed
Get table names.
where()  : mixed
Get where clause.
whereClauseSingle()  : mixed
Get where clause for a single value.
getFieldName()  : string
Get the name of the field.
getLegacySupportedFields()  : array<string|int, mixed>
Get legacy fields which we still maybe support.
addSoftCreditFields()  : mixed
Add the soft credit fields to the select fields.

Properties

$_contribOrSoftCredit

public static mixed $_contribOrSoftCredit = "only_contribs"

$_contribRecurPayment

public static mixed $_contribRecurPayment = \NULL

Methods

addCustomFormFields()

public static addCustomFormFields(CRM_Core_Form &$form, array<string|int, mixed> $extends) : mixed
Parameters
$form : CRM_Core_Form
$extends : array<string|int, mixed>

buildDateWhere()

Add the where for dates.

public static buildDateWhere(array<string|int, mixed> &$values, object $query, string $name, string $field, string $title) : bool
Parameters
$values : array<string|int, mixed>

Array of query values.

$query : object

The query object.

$name : string

Query field that is set.

$field : string

Name of field to be set.

$title : string

Title of the field.

Return values
bool

defaultReturnProperties()

Function you should avoid.

public static defaultReturnProperties(int $mode[, bool $includeCustomFields = TRUE ]) : array<string|int, mixed>|null

This function returns default properties for contribution queries. However, they are far more than are required in 'most' cases and you should always try to return the return properties you actually require.

It would be nice to throw an e-notice when this is called but it would trash the tests :-(.

Parameters
$mode : int
$includeCustomFields : bool = TRUE
Return values
array<string|int, mixed>|null

from()

Get from clause.

public static from(string $name, int $mode, string $side) : null|string
Parameters
$name : string
$mode : int
$side : string
Return values
null|string

getFields()

Function get the searchable fields for contribution.

public static getFields([bool $checkPermission = TRUE ]) : array<string|int, mixed>

This is basically the contribution fields plus some related entity fields.

Parameters
$checkPermission : bool = TRUE
Return values
array<string|int, mixed>

Associative array of contribution fields

getSearchFieldMetadata()

Get the metadata for fields to be included on the search form.

public static getSearchFieldMetadata() : mixed
Tags
throws
CRM_Core_Exception

isSiteHasProducts()

Do any products exist in this site's database.

public static isSiteHasProducts() : bool
Return values
bool

isSoftCreditOptionEnabled()

Check if soft credits are enables.

public static isSoftCreditOptionEnabled([array<string|int, mixed> $queryParams = [] ]) : bool
Parameters
$queryParams : array<string|int, mixed> = []
Return values
bool

qill()

Getter for the qill object.

public qill() : string
Return values
string

searchAction()

Possibly unnecessary function.

public static searchAction(mixed &$row, int $id) : mixed
Parameters
$row : mixed
$id : int

selectorReturnProperties()

Get the list of fields required to populate the selector.

public static selectorReturnProperties(array<string|int, mixed> $queryParams) : array<string|int, mixed>

The default return properties array returns far too many fields for 'everyday use. Every field you add to this array kills a small kitten so add carefully.

Parameters
$queryParams : array<string|int, mixed>
Return values
array<string|int, mixed>

softCreditReturnProperties()

Get return properties for soft credits.

public static softCreditReturnProperties([bool $isExportMode = FALSE ]) : array<string|int, mixed>
Parameters
$isExportMode : bool = FALSE
Return values
array<string|int, mixed>

tableNames()

Get table names.

public static tableNames(array<string|int, mixed> &$tables) : mixed
Parameters
$tables : array<string|int, mixed>
Tags
todo

better function comment needed - what IS the point of this?

getFieldName()

Get the name of the field.

protected static getFieldName(array<string|int, mixed> $values) : string
Parameters
$values : array<string|int, mixed>
Return values
string

getLegacySupportedFields()

Get legacy fields which we still maybe support.

protected static getLegacySupportedFields() : array<string|int, mixed>

These are contribution specific but I think it's ok to have one list of legacy supported params in a central place.

Return values
array<string|int, mixed>

addSoftCreditFields()

Add the soft credit fields to the select fields.

private static addSoftCreditFields(CRM_Contact_BAO_Query &$query) : mixed

Extracted into separate function to improve readability of main select function.

Parameters
$query : CRM_Contact_BAO_Query

        
On this page

Search results