Automattic\WooCommerce\Internal\Admin\Reports
HposLegacyOrderReportQueryBuilder::get_report_schema
Get HPOS schema details used by the report SQL builder (column mappings and gmt offset).
Method of the class: HposLegacyOrderReportQueryBuilder{}
No Hooks.
Returns
array<string,mixed>.
Usage
// private - for code of main (parent) class only $result = $this->get_report_schema(): array;
HposLegacyOrderReportQueryBuilder::get_report_schema() HposLegacyOrderReportQueryBuilder::get report schema code WC 11.3.0
private function get_report_schema(): array {
if ( null !== $this->report_schema ) {
return $this->report_schema;
}
$this->report_schema = array(
'gmt_offset' => (int) ( (float) get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ),
'order_column' => array(
'_order_total' => 'orders.total_amount',
'_order_tax' => 'orders.tax_amount',
// On a refund row, wc_orders.total_amount stores the negative refund total.
// Legacy callers expect the positive `_refund_amount` meta value, so it
// is intentionally not mapped here.
),
'op_data_column' => array(
'_order_shipping' => 'op_data.shipping_total_amount',
'_order_shipping_tax' => 'op_data.shipping_tax_amount',
),
'where_meta_column' => array(
'_customer_user' => 'orders.customer_id',
),
'address_column' => $this->build_address_column_map(),
);
return $this->report_schema;
}