class CRM_Contribute_BAO_Query extends CRM_Core_BAO_Query

Properties

static $_contribOrSoftCredit
static $_contribRecurPayment

Methods

static 
addCustomFormFields(CRM_Core_Form $form, array $extends)

No description

static array
getLegacySupportedFields()

Get legacy fields which we still maybe support.

string
qill()

Getter for the qill object.

static 
searchAction($row, int $id)

Possibly unnecessary function.

static 
tableNames($tables)

Get table names.

static string
getFieldName(array $values)

Get the name of the field.

static array
getFields(bool $checkPermission = TRUE)

Function get the searchable fields for contribution.

static 
select(CRM_Contact_BAO_Query $query)

If contributions are involved, add the specific contribute fields.

static 
where(CRM_Contact_BAO_Query $query)

Get where clause.

static 
whereClauseSingle(array $values, CRM_Contact_BAO_Query $query)

Get where clause for a single value.

static NULL|string
from(string $name, string $mode, string $side)

Get from clause.

static 
initializeAnySoftCreditClause(CRM_Contact_BAO_Query $query)

Initialise the soft credit clause.

static bool
isSoftCreditOptionEnabled(array $queryParams = [])

Check if soft credits are enables.

static array
softCreditReturnProperties(bool $isExportMode = FALSE)

Get return properties for soft credits.

static array
selectorReturnProperties(array $queryParams)

Get the list of fields required to populate the selector.

static bool
isSiteHasProducts()

Do any products exist in this site's database.

static array|NULL
defaultReturnProperties(int $mode, bool $includeCustomFields = TRUE)

Function you should avoid.

static 
getSearchFieldMetadata()

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

static 
buildSearchForm(CRM_Contribute_Form_Search $form)

Add all the elements shared between contribute search and advanced search.

static bool
buildDateWhere(array $values, object $query, string $name, string $field, string $title)

Add the where for dates.

Details

in CRM_Core_BAO_Query at line 41
static addCustomFormFields(CRM_Core_Form $form, array $extends)

Parameters

CRM_Core_Form $form
array $extends

in CRM_Core_BAO_Query at line 69
static protected array getLegacySupportedFields()

Get legacy fields which we still maybe support.

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

Return Value

array

in CRM_Core_BAO_Query at line 87
string qill()

Getter for the qill object.

Return Value

string

in CRM_Core_BAO_Query at line 97
static searchAction($row, int $id)

Possibly unnecessary function.

Parameters

$row
int $id

at line 1066
static tableNames($tables)

Get table names.

Parameters

$tables

in CRM_Core_BAO_Query at line 111
static protected string getFieldName(array $values)

Get the name of the field.

Parameters

array $values

Return Value

string

at line 49
static array getFields(bool $checkPermission = TRUE)

Function get the searchable fields for contribution.

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

Parameters

bool $checkPermission

Return Value

array Associative array of contribution fields

at line 73
static select(CRM_Contact_BAO_Query $query)

If contributions are involved, add the specific contribute fields.

Parameters

CRM_Contact_BAO_Query $query

at line 116
static where(CRM_Contact_BAO_Query $query)

Get where clause.

Parameters

CRM_Contact_BAO_Query $query

at line 153
static whereClauseSingle(array $values, CRM_Contact_BAO_Query $query)

Get where clause for a single value.

Parameters

array $values
CRM_Contact_BAO_Query $query

Exceptions

CiviCRM_API3_Exception
CRM_Core_Exception

at line 520
static NULL|string from(string $name, string $mode, string $side)

Get from clause.

Parameters

string $name
string $mode
string $side

Return Value

NULL|string

at line 657
static initializeAnySoftCreditClause(CRM_Contact_BAO_Query $query)

Initialise the soft credit clause.

Parameters

CRM_Contact_BAO_Query $query

at line 679
static bool isSoftCreditOptionEnabled(array $queryParams = [])

Check if soft credits are enables.

Parameters

array $queryParams

Return Value

bool

at line 719
static array softCreditReturnProperties(bool $isExportMode = FALSE)

Get return properties for soft credits.

Parameters

bool $isExportMode

Return Value

array

at line 741
static array selectorReturnProperties(array $queryParams)

Get the list of fields required to populate the selector.

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

array $queryParams

Return Value

array

at line 778
static bool isSiteHasProducts()

Do any products exist in this site's database.

Return Value

bool

at line 799
static array|NULL defaultReturnProperties(int $mode, bool $includeCustomFields = TRUE)

Function you should avoid.

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

int $mode
bool $includeCustomFields

Return Value

array|NULL

at line 907
static getSearchFieldMetadata()

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

at line 927
static buildSearchForm(CRM_Contribute_Form_Search $form)

Add all the elements shared between contribute search and advanced search.

at line 1093
static bool buildDateWhere(array $values, object $query, string $name, string $field, string $title)

Add the where for dates.

Parameters

array $values Array of query values.
object $query The query object.
string $name Query field that is set.
string $field Name of field to be set.
string $title Title of the field.

Return Value

bool