Automattic\WooCommerce\Caching

ObjectCache::is_cached()publicWC 1.0

Is a given object cached?

{} It's a method of the class: ObjectCache{}

No Hooks.

Return

true|false. True if there's a cached object with the specified id.

Usage

$ObjectCache = new ObjectCache();
$ObjectCache->is_cached( $id ): bool;
$id(int|string) (required)
The id of the object to check.

Code of ObjectCache::is_cached() WC 7.1.0

public function is_cached( $id ): bool {
	return $this->get_cache_engine()->is_cached( $this->get_cache_key_prefix() . $id );
}