Automattic\WooCommerce\Admin\API\Reports

DataStore::should_use_cache()protectedWC 1.0

Whether or not the report should use the caching layer.

Provides an opportunity for plugins to prevent reports from using cache.

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

Возвращает

true|false. Whether or not to utilize caching.

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

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

Код DataStore::should_use_cache() WC 8.7.0

protected function should_use_cache() {
	/**
	 * Determines if a report will utilize caching.
	 *
	 * @param bool $use_cache Whether or not to use cache.
	 * @param string $cache_key The report's cache key. Used to identify the report.
	 */
	return (bool) apply_filters( 'woocommerce_analytics_report_should_use_cache', true, $this->cache_key );
}