Automattic\WooCommerce\Internal\DataStores\Orders

DataSynchronizer::do_pending_orders_synchronization()privateWC 1.0

Run one orders synchronization batch.

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

Возвращает

null. Ничего.

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

// private - только в коде основоного (родительского) класса
$result = $this->do_pending_orders_synchronization();

Код DataSynchronizer::do_pending_orders_synchronization() WC 6.6.1

private function do_pending_orders_synchronization() {
	if ( ! $this->pending_data_sync_is_in_progress() ) {
		return;
	}

	// TODO: Remove the usage of the fake pending orders count once development of the feature is complete.
	$fake_count = get_option( self::FAKE_ORDERS_PENDING_SYNC_COUNT_OPTION );
	if ( false !== $fake_count ) {
		update_option( 'woocommerce_fake_orders_pending_sync_count', (int) $fake_count - 1 );
	} else {
		$this->sync_next_batch();
	}

	if ( 0 === $this->get_current_orders_pending_sync_count() ) {
		$this->cleanup_synchronization_state();

		/**
		 * Hook to signal that the orders tables synchronization process has finished (nothing left to synchronize).
		 *
		 * @since 6.5.0
		 */
		do_action( self::PENDING_SYNCHRONIZATION_FINISHED_ACTION );
	} else {
		$this->schedule_pending_orders_synchronization();
	}
}