Automattic\WooCommerce\Caching

ObjectCache::get_cache_engine()privateWC 1.0

Get the cache engine to use and cache it internally.

Method of the class: ObjectCache{}

Hooks from the method

Return

CacheEngine.

Usage

// private - for code of main (parent) class only
$result = $this->get_cache_engine(): CacheEngine;

ObjectCache::get_cache_engine() code WC 9.4.2

private function get_cache_engine(): CacheEngine {
	if ( null === $this->cache_engine ) {
		$engine = $this->get_cache_engine_instance();

		/**
		 * Filters the underlying cache engine to be used by an instance of ObjectCache.
		 *
		 * @since 7.4.0
		 *
		 * @param CacheEngine $engine The cache engine to be used by default.
		 * @param ObjectCache $cache_instance The instance of ObjectCache that will use the cache engine.
		 * @returns CacheEngine The actual cache engine that will be used.
		 */
		$this->cache_engine = apply_filters( 'wc_object_cache_get_engine', $engine, $this );
	}
	return $this->cache_engine;
}