- // call export hook
- $table = $processor->getTemporaryTable();
- CRM_Utils_Hook::export($table, $headerRows, $sqlColumns, $exportMode, $componentTable, $ids);
- if ($table !== $processor->getTemporaryTable()) {
- CRM_Core_Error::deprecatedFunctionWarning('altering the export table in the hook is deprecated (in some flows the table itself will be)');
- $processor->setTemporaryTable($table);
- }
-
- // In order to be able to write a unit test against this function we need to suppress
- // the csv writing. In future hopefully the csv writing & the main processing will be in separate functions.
- if (empty($exportParams['suppress_csv_for_testing'])) {
- self::writeCSVFromTable($headerRows, $processor);
- }
- else {
- // return tableName sqlColumns headerRows in test context
- return [$processor->getTemporaryTable(), $sqlColumns, $headerRows, $processor];
- }