CRM_Export_BAO_Export
class CRM_Export_BAO_Export
This class contains the functions for Component export
Constants
EXPORT_ROW_COUNT |
|
Methods
Get Querymode based on ExportMode
Get default return property for export based on mode
Get Export component
Get Query Group By Clause
Define extra properties for the export based on query mode
Get the list the export fields.
Name of the export file based on mode.
Handle import error file creation.
No description
No description
No description
No description
No description
No description
The function unsets static part of the string, if token is the dynamic part.
No description
Merge household record into the individual record if exists
No description
Manipulate header rows for relationship fields.
Exclude contacts who are deceased, have "Do not mail" privacy setting, or have no street address
Build componentPayment fields.
Set the definition for the header rows and sql columns based on the field to output.
Get the various arrays that we use to structure our output.
Details
at line 55
static string
getQueryMode(int $exportMode)
Get Querymode based on ExportMode
at line 99
static string
defaultReturnProperty(int $exportMode)
Get default return property for export based on mode
at line 135
static string
exportComponent(int $exportMode)
Get Export component
at line 174
static string
getGroupBy(int $exportMode, string $queryMode, array $returnProperties, object $query)
Get Query Group By Clause
at line 221
static array
defineExtraProperties(string $queryMode)
Define extra properties for the export based on query mode
at line 290
static
exportComponents(int $selectAll, array $ids, array $params, string $order = NULL, array $fields = NULL, array $moreReturnProperties = NULL, int $exportMode = CRM_Export_Form_Select::CONTACT_EXPORT, string $componentClause = NULL, string $componentTable = NULL, bool $mergeSameAddress = FALSE, bool $mergeSameHousehold = FALSE, array $exportParams = array(), string $queryOperator = 'AND')
Get the list the export fields.
at line 1132
static string
getExportFileName(string $output = 'csv', int $mode = CRM_Export_Form_Select::CONTACT_EXPORT)
Name of the export file based on mode.
at line 1163
static
invoke()
Handle import error file creation.
at line 1205
static
exportCustom($customSearchClass, $formValues, $order)
at line 1255
static
sqlColumnDefn($query, $sqlColumns, $field)
at line 1391
static
writeDetailsToTable(string $tableName, $details, $sqlColumns)
at line 1439
static string
createTempTable($sqlColumns)
at line 1485
static
mergeSameAddress(string $tableName, $headerRows, $sqlColumns, array $exportParams)
at line 1594
static array
_replaceMergeTokens(int $contactId, array $exportParams)
at line 1638
static mixed
_trimNonTokens(string $parsedString, string $defaultGreeting, bool $addressMergeGreetings, string $greetingType = 'postal_greeting')
The function unsets static part of the string, if token is the dynamic part.
Example: 'Hello {contact.first_name}' => converted to => '{contact.first_name}' i.e 'Hello Alan' => converted to => 'Alan'
at line 1665
static array
_buildMasterCopyArray($sql, array $exportParams, bool $sharedAddress = FALSE)
at line 1774
static
mergeSameHousehold(string $exportTempTable, array $headerRows, array $sqlColumns, string $prefix)
Merge household record into the individual record if exists
at line 1855
static
writeCSVFromTable($exportTempTable, $headerRows, $sqlColumns, $exportMode, null $saveFile = NULL, string $batchItems = '')
at line 1909
static
manipulateHeaderRows($headerRows, $contactRelationshipTypes)
Manipulate header rows for relationship fields.
at line 1927
static
postalMailingFormat($exportTempTable, $headerRows, $sqlColumns, $exportParams)
Exclude contacts who are deceased, have "Do not mail" privacy setting, or have no street address
at line 1979
static
componentPaymentFields()
Build componentPayment fields.
at line 2009
static array
setHeaderRows(string $field, array $headerRows, array $sqlColumns, CRM_Contact_BAO_Query $query, array|string $value, array $phoneTypes, array $imProviders, array $contactRelationshipTypes, string $relationQuery, array $selectedPaymentFields)
Set the definition for the header rows and sql columns based on the field to output.
at line 2139
static array
getExportStructureArrays(array $returnProperties, CRM_Contact_BAO_Contact $query, array $phoneTypes, array $imProviders, array $contactRelationshipTypes, string $relationQuery, array $selectedPaymentFields)
Get the various arrays that we use to structure our output.
The extraction of these has been moved to a separate function for clarity and so that tests can be added - in particular on the $outputHeaders array.
However it still feels a bit like something that I'm too polite to write down and this should be seen as a step on the refactoring path rather than how it should be.