Automattic\WooCommerce\Database\Migrations\CustomOrderTable

PostToOrderAddressTableMigrator::get_schema_config()protectedWC 1.0

Get schema config for wp_posts and wc_order_address table.

{} Это метод класса: PostToOrderAddressTableMigrator{}

Хуков нет.

Возвращает

Массив. Config.

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

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

Код PostToOrderAddressTableMigrator::get_schema_config() WC 6.8.0

protected function get_schema_config(): array {
	global $wpdb;
	// TODO: Remove hardcoding.
	$this->table_names = array(
		'orders'    => $wpdb->prefix . 'wc_orders',
		'addresses' => $wpdb->prefix . 'wc_order_addresses',
		'op_data'   => $wpdb->prefix . 'wc_order_operational_data',
		'meta'      => $wpdb->prefix . 'wc_orders_meta',
	);

	return array(
		'source'      => array(
			'entity' => array(
				'table_name'             => $this->table_names['orders'],
				'meta_rel_column'        => 'id',
				'destination_rel_column' => 'id',
				'primary_key'            => 'id',
			),
			'meta'   => array(
				'table_name'        => $wpdb->postmeta,
				'meta_key_column'   => 'meta_key',
				'meta_value_column' => 'meta_value',
				'entity_id_column'  => 'post_id',
			),
		),
		'destination' => array(
			'table_name'        => $this->table_names['addresses'],
			'source_rel_column' => 'order_id',
			'primary_key'       => 'id',
			'primary_key_type'  => 'int',
		),
	);
}