*/
class CRM_Contribute_BAO_Query extends CRM_Core_BAO_Query {
- /**
- * Static field for all the export/import contribution fields.
- *
- * @var array
- */
- static $_contributionFields = NULL;
-
static $_contribOrSoftCredit = "only_contribs";
static $_contribRecurPayment = NULL;
* Associative array of contribution fields
*/
public static function getFields($checkPermission = TRUE) {
- if (!self::$_contributionFields) {
- self::$_contributionFields = array();
-
- $fields = CRM_Contribute_BAO_Contribution::exportableFields($checkPermission);
-
+ if (!isset(\Civi::$statics[__CLASS__]) || !isset(\Civi::$statics[__CLASS__]['fields']) || !isset(\Civi::$statics[__CLASS__]['contribution'])) {
+ $fields = CRM_Contribute_BAO_Contribution::exportableFields($checkPermission);
unset($fields['contribution_contact_id']);
-
- self::$_contributionFields = $fields;
+ \Civi::$statics[__CLASS__]['fields']['contribution'] = $fields;
}
- return self::$_contributionFields;
+ return \Civi::$statics[__CLASS__]['fields']['contribution'];
}
/**
CRM_Contact_BAO_Contact::$_importableFields = CRM_Contact_BAO_Contact::$_exportableFields
= CRM_Contribute_BAO_Contribution::$_importableFields
= CRM_Contribute_BAO_Contribution::$_exportableFields
- = CRM_Pledge_BAO_Pledge::$_exportableFields = CRM_Contribute_BAO_Query::$_contributionFields
+ = CRM_Pledge_BAO_Pledge::$_exportableFields
= CRM_Core_BAO_CustomField::$_importFields
= CRM_Core_BAO_Cache::$_cache = CRM_Core_DAO::$_dbColumnValueCache = NULL;