Automattic\WooCommerce\Internal\DataStores\Orders

OrdersTableDataStore::clear_all_cached_data()publicWC 1.0

Invalidate all the cache used by this data store.

Method of the class: OrdersTableDataStore{}

No Hooks.

Return

true|false. Whether the cache as fully invalidated.

Usage

$OrdersTableDataStore = new OrdersTableDataStore();
$OrdersTableDataStore->clear_all_cached_data(): bool;

OrdersTableDataStore::clear_all_cached_data() code WC 9.6.0

public function clear_all_cached_data(): bool {
	if ( ! OrderUtil::custom_orders_table_datastore_cache_enabled() ) {
		return true;
	}

	$cache_engine       = wc_get_container()->get( WPCacheEngine::class );
	$orders_invalidated = $cache_engine->delete_cache_group( $this->get_cache_group() );
	$meta_invalidated   = true;
	if ( is_callable( array( $this->data_store_meta, 'clear_cached_data' ) ) ) {
		$meta_invalidated = $this->data_store_meta->clear_all_cached_data();
	}

	return $orders_invalidated && $meta_invalidated;
}