Automattic\WooCommerce\Admin

ReportExporter::get_page_exporter │ private static │ WC 1.0

Get the exporter that writes one page of an export to the export file.

Method of the class: ReportExporter{}

No Hooks.

Returns

ReportCSVExporter.

Usage

$result = ReportExporter::get_page_exporter( $page_number, $export_id, $report_type, $report_args );
$page_number(int) (required)
Page number.
$export_id(string) (required)
Unique ID for report (timestamp expected).
$report_type(string) (required)
Report type. E.g. 'customers'.
$report_args(array) (required)
Report parameters, passed to data query.

ReportExporter::get_page_exporter() code WC 11.3.0

private static function get_page_exporter( $page_number, $export_id, $report_type, $report_args ) {
	// The arguments come from a scheduled action, so they are whatever it was queued with.
	$report_args = is_array( $report_args ) ? $report_args : array();

	$exporter = new ReportCSVExporter( $report_type, array_merge( $report_args, array( 'page' => $page_number ) ) );
	$exporter->set_filename( self::get_export_filename( $report_type, $export_id ) );

	return $exporter;
}