Automattic\WooCommerce\Database\Migrations\CustomOrderTable

PostMetaToOrderMetaMigrator::get_meta_config()protectedWC 1.0

Generate config for meta data migration.

Method of the class: PostMetaToOrderMetaMigrator{}

No Hooks.

Return

Array. Meta data migration config.

Usage

// protected - for code of main (parent) or child class
$result = $this->get_meta_config(): array;

PostMetaToOrderMetaMigrator::get_meta_config() code WC 8.7.0

protected function get_meta_config(): array {
	global $wpdb;

	return array(
		'source'      => array(
			'meta'          => array(
				'table_name'        => $wpdb->postmeta,
				'entity_id_column'  => 'post_id',
				'meta_id_column'    => 'meta_id',
				'meta_key_column'   => 'meta_key',
				'meta_value_column' => 'meta_value',
			),
			'entity'        => array(
				'table_name'       => $wpdb->posts,
				'source_id_column' => 'ID',
				'id_column'        => 'ID',
			),
			'excluded_keys' => $this->excluded_columns,
		),
		'destination' => array(
			'meta' => array(
				'table_name'        => OrdersTableDataStore::get_meta_table_name(),
				'entity_id_column'  => 'order_id',
				'meta_key_column'   => 'meta_key',
				'meta_value_column' => 'meta_value',
				'entity_id_type'    => 'int',
				'meta_id_column'    => 'id',
			),
		),
	);
}