Automattic\WooCommerce\Internal\DataStores\Orders

DataSynchronizer::get_current_orders_pending_sync_countpublicWC 1.0

Calculate how many orders need to be synchronized currently. A database query is performed to get how many orders match one of the following:

  • Existing in the authoritative table but not in the backup table.
  • Existing in both tables, but they have a different update date.

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

Хуков нет.

Возвращает

null. Ничего (null).

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

$DataSynchronizer = new DataSynchronizer();
$DataSynchronizer->get_current_orders_pending_sync_count( $use_cache ): int;
$use_cache(true|false)
Whether to use the cached value instead of fetching from database.
По умолчанию: false

Код DataSynchronizer::get_current_orders_pending_sync_count() WC 10.7.0

public function get_current_orders_pending_sync_count( $use_cache = false ): int {
	if ( $use_cache ) {
		$pending_count = wp_cache_get( 'woocommerce_hpos_pending_sync_count', 'counts' );
		if ( false !== $pending_count ) {
			return (int) $pending_count;
		}
	}

	$pending_count = $this->query_orders_pending_sync_count();

	wp_cache_set( 'woocommerce_hpos_pending_sync_count', $pending_count, 'counts' );
	return $pending_count;
}