Automattic\WooCommerce\Caching

ObjectCache::get_cache_engine()privateWC 1.0

Get the cache engine to use and cache it internally.

{} Это метод класса: ObjectCache{}

Хуки из метода

Возвращает

CacheEngine.

Использование

// private - только в коде основоного (родительского) класса
$result = $this->get_cache_engine(): CacheEngine;

Код ObjectCache::get_cache_engine() WC 6.9.4

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;
}