本文整理汇总了PHP中CRM_Batch_BAO_Batch::_exportFormat方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Batch_BAO_Batch::_exportFormat方法的具体用法?PHP CRM_Batch_BAO_Batch::_exportFormat怎么用?PHP CRM_Batch_BAO_Batch::_exportFormat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Batch_BAO_Batch
的用法示例。
在下文中一共展示了CRM_Batch_BAO_Batch::_exportFormat方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: exportFinancialBatch
/**
* Function for exporting financial accounts, currently we support CSV and IIF format
* @see http://wiki.civicrm.org/confluence/display/CRM/CiviAccounts+Specifications+-++Batches#CiviAccountsSpecifications-Batches-%C2%A0Overviewofimplementation
*
* @param array $batchIds
* Associated array of batch ids.
* @param string $exportFormat
* Export format.
*/
public static function exportFinancialBatch($batchIds, $exportFormat)
{
if (empty($batchIds)) {
CRM_Core_Error::fatal(ts('No batches were selected.'));
return;
}
if (empty($exportFormat)) {
CRM_Core_Error::fatal(ts('No export format selected.'));
return;
}
self::$_exportFormat = $exportFormat;
// Instantiate appropriate exporter based on user-selected format.
$exporterClass = "CRM_Financial_BAO_ExportFormat_" . self::$_exportFormat;
if (class_exists($exporterClass)) {
$exporter = new $exporterClass();
} else {
CRM_Core_Error::fatal("Could not locate exporter: {$exporterClass}");
}
foreach ($batchIds as $batchId) {
$export[$batchId] = $exporter->generateExportQuery($batchId);
}
$exporter->makeExport($export);
}