CRM_Contribute_BAO_Query
extends CRM_Core_BAO_Query
in package
Tags
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
boolbuildSearchForm()
Add all the elements shared between contribute search and advanced search.
public
static buildSearchForm(CRM_Contribute_Form_Search &$form) : mixed
Parameters
- $form : CRM_Contribute_Form_Search
Tags
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>|nullfrom()
Get from clause.
public
static from(string $name, int $mode, string $side) : null|string
Parameters
- $name : string
- $mode : int
- $side : string
Return values
null|stringgetFields()
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
initializeAnySoftCreditClause()
Initialise the soft credit clause.
public
static initializeAnySoftCreditClause(CRM_Contact_BAO_Query &$query) : mixed
Parameters
- $query : CRM_Contact_BAO_Query
isSiteHasProducts()
Do any products exist in this site's database.
public
static isSiteHasProducts() : bool
Return values
boolisSoftCreditOptionEnabled()
Check if soft credits are enables.
public
static isSoftCreditOptionEnabled([array<string|int, mixed> $queryParams = [] ]) : bool
Parameters
- $queryParams : array<string|int, mixed> = []
Return values
boolqill()
Getter for the qill object.
public
qill() : string
Return values
stringsearchAction()
Possibly unnecessary function.
public
static searchAction(mixed &$row, int $id) : mixed
Parameters
- $row : mixed
- $id : int
select()
If contributions are involved, add the specific contribute fields.
public
static select(CRM_Contact_BAO_Query &$query) : mixed
Parameters
- $query : CRM_Contact_BAO_Query
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
where()
Get where clause.
public
static where(CRM_Contact_BAO_Query &$query) : mixed
Parameters
- $query : CRM_Contact_BAO_Query
Tags
whereClauseSingle()
Get where clause for a single value.
public
static whereClauseSingle(array<string|int, mixed> &$values, CRM_Contact_BAO_Query &$query) : mixed
Parameters
- $values : array<string|int, mixed>
- $query : CRM_Contact_BAO_Query
Tags
getFieldName()
Get the name of the field.
protected
static getFieldName(array<string|int, mixed> $values) : string
Parameters
- $values : array<string|int, mixed>
Return values
stringgetLegacySupportedFields()
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