Automattic\WooCommerce\Database\Migrations\CustomOrderTable

PostsToOrdersMigrationController::maybe_clear_order_datastore_cache_for_ids()privateWC 1.0

Clear the cache of order data for modified orders during migration if cache is enabled.

Method of the class: PostsToOrdersMigrationController{}

No Hooks.

Return

null. Nothing (null).

Usage

// private - for code of main (parent) class only
$result = $this->maybe_clear_order_datastore_cache_for_ids( $order_post_ids );
$order_post_ids(array) (required)
List of order IDs of the orders to clear from cache.

PostsToOrdersMigrationController::maybe_clear_order_datastore_cache_for_ids() code WC 9.7.1

private function maybe_clear_order_datastore_cache_for_ids( array $order_post_ids ) {
	if ( OrderUtil::custom_orders_table_datastore_cache_enabled() ) {
		$orders_table_datastore = wc_get_container()->get( OrdersTableDataStore::class );
		if ( is_callable( array( $orders_table_datastore, 'clear_cached_data' ) ) ) {
			$orders_table_datastore->clear_cached_data( $order_post_ids );
		}
	}
}