WooCommerce Code Reference

OrderCacheController
in package
Uses AccessiblePrivateMethods

A class to control the usage of the orders cache.

Table of Contents

$features_controller  : FeaturesController
The orders cache to use.
$order_cache  : OrderCache
The orders cache to use.
$orders_cache_usage_backup  : null|bool
The backup value of the cache usage enable status, stored while the cache is temporarily disabled.
maybe_restore_orders_cache_usage()  : void
Restore the order cache usage that had been temporarily disabled.
orders_cache_usage_is_enabled()  : bool
Whether order cache usage is enabled. Currently, linked to custom orders' table usage.
orders_cache_usage_is_temporarly_disabled()  : bool
Check if the order cache has been temporarily disabled.
temporarily_disable_orders_cache_usage()  : void
Temporarily disable the order cache if it's enabled.

Properties

$orders_cache_usage_backup

The backup value of the cache usage enable status, stored while the cache is temporarily disabled.

private null|bool $orders_cache_usage_backup = null

Methods

maybe_restore_orders_cache_usage()

Restore the order cache usage that had been temporarily disabled.

public maybe_restore_orders_cache_usage() : void
Return values
void

orders_cache_usage_is_enabled()

Whether order cache usage is enabled. Currently, linked to custom orders' table usage.

public orders_cache_usage_is_enabled() : bool
Return values
boolTrue if the order cache is enabled.

orders_cache_usage_is_temporarly_disabled()

Check if the order cache has been temporarily disabled.

public orders_cache_usage_is_temporarly_disabled() : bool
Return values
boolTrue if the order cache is currently temporarily disabled.

temporarily_disable_orders_cache_usage()

Temporarily disable the order cache if it's enabled.

public temporarily_disable_orders_cache_usage() : void

This is a purely in-memory operation: a variable is created with the value of the current enable status for the feature, and this variable is checked by orders_cache_usage_is_enabled. In the next request the feature will be again enabled or not depending on how the feature is set.

Return values
void