Automattic\WooCommerce\Internal\DataStores\Orders
OrdersTableDataStore::clear_all_cached_data
Invalidate all the cache used by this data store.
Method of the class: OrdersTableDataStore{}
No Hooks.
Returns
true|false. Whether the cache as fully invalidated.
Usage
$OrdersTableDataStore = new OrdersTableDataStore(); $OrdersTableDataStore->clear_all_cached_data(): bool;
OrdersTableDataStore::clear_all_cached_data() OrdersTableDataStore::clear all cached data code WC 10.4.3
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;
}