ObjectCache::get_cache_engine()privateWC 1.0

Get the cache engine to use and cache it internally.

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

Hooks from the method




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

Code of ObjectCache::get_cache_engine() WC 7.1.0

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 6.8.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;