Automattic\WooCommerce\Internal\DataStores\Orders

OrdersTableDataStore::clear_all_cached_data()publicWC 1.0

Invalidate all the cache used by this data store.

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

Хуков нет.

Возвращает

true|false. Whether the cache as fully invalidated.

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

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

Код OrdersTableDataStore::clear_all_cached_data() WC 9.7.1

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;
}