Automattic\WooCommerce\Internal\Admin\Reports

HposLegacyOrderReportQueryBuilder::get_report_schema │ private │ WC 1.0

Get HPOS schema details used by the report SQL builder (column mappings and gmt offset).

Метод класса: HposLegacyOrderReportQueryBuilder{}

Хуков нет.

Возвращает

array<string,mixed>.

Использование

// private - только в коде основоного (родительского) класса
$result = $this->get_report_schema(): array;

Код HposLegacyOrderReportQueryBuilder::get_report_schema() WC 11.2.2

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;
}