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