Automattic\WooCommerce\Caches

OrderCountCache::setpublicWC 1.0

Set the cache value for a given order type and status.

Method of the class: OrderCountCache{}

No Hooks.

Returns

true|false. True if the value was set, false otherwise.

Usage

$OrderCountCache = new OrderCountCache();
$OrderCountCache->set( $order_type, $order_status, $value ): bool;
$order_type(string) (required)
The type of order.
$order_status(string) (required)
The status slug of the order.
$value(int) (required)
The value to set.

OrderCountCache::set() code WC 10.7.0

public function set( $order_type, $order_status, int $value ): bool {
	$this->ensure_statuses_for_type( (string) $order_type, array( (string) $order_status ) );
	$cache_key = $this->get_cache_key( $order_type, $order_status );
	return wp_cache_set( $cache_key, $value, '', $this->expiration );
}