Automattic\WooCommerce\Internal\DataStores\Orders

OrdersTableDataStore::migrate_post_record()privateWC 1.0

Migrate post record from a given order object.

Method of the class: OrdersTableDataStore{}

No Hooks.

Return

null. Nothing.

Usage

// private - for code of main (parent) class only
$result = $this->migrate_post_record( $order, $post_order ): void;
$order(\WC_Abstract_Order) (required)
Order object.
$post_order(\WC_Abstract_Order) (required)
Order object read from posts.

OrdersTableDataStore::migrate_post_record() code WC 7.1.0

private function migrate_post_record( \WC_Abstract_Order &$order, \WC_Abstract_Order $post_order ): void {
	$this->migrate_meta_data_from_post_order( $order, $post_order );
	$post_order_base_data = $post_order->get_base_data();
	foreach ( $post_order_base_data as $key => $value ) {
		$this->set_order_prop( $order, $key, $value );
	}
	$this->persist_updates( $order, false );
}