Automattic\WooCommerce\Caching
CacheEngine::cache_object()
Caches an object under a given key, and with a given expiration.
Метод класса: CacheEngine{}
Хуков нет.
Возвращает
true|false
. True if the object is cached successfully, false otherwise.
Использование
$CacheEngine = new CacheEngine(); $CacheEngine->cache_object( $key, $object, $expiration, $group ): bool;
- $key(строка) (обязательный)
- The key under which the object will be cached.
- $object(массив|объект) (обязательный)
- The object to cache.
- $expiration(int) (обязательный)
- Expiration for the cached object, in seconds.
- $group(строка)
- The group under which the object will be cached.
По умолчанию: ''
Код CacheEngine::cache_object() CacheEngine::cache object WC 8.1.1
public function cache_object( string $key, $object, int $expiration, string $group = '' ): bool;