Documentation

SerializedCache
in package
implements Cache uses ForbidCloning, ForbidSerialization

FinalYes
Tags
template
implements

Table of Contents

Interfaces

Cache

Properties

$cache  : StringCache
$serializer  : Serializer

Methods

__construct()  : mixed
__serialize()  : never
__unserialize()  : never
delete()  : bool|null
Deletes a value associated with the given key if it exists.
get()  : TValue
Fetch a value from the cache and unserialize it.
set()  : void
Serializes a value and stores its serialization to the cache.
__clone()  : mixed

Properties

Methods

__unserialize()

public final __unserialize(array<string|int, mixed> $data) : never
Parameters
$data : array<string|int, mixed>
Return values
never

delete()

Deletes a value associated with the given key if it exists.

public delete(mixed $key) : bool|null
Parameters
$key : mixed

string Cache key.

Tags
throws
CacheException
see
StringCache::delete()
Return values
bool|null

Returns true / false to indicate whether the key existed, or null if that information is not available.

set()

Serializes a value and stores its serialization to the cache.

public set(string $key, TValue $value[, int|null $ttl = null ]) : void
Parameters
$key : string

Cache key.

$value : TValue

Value to cache.

$ttl : int|null = null

Timeout in seconds. The default null $ttl value indicates no timeout. Values less than 0 MUST throw an \Error.

Tags
throws
CacheException
throws
SerializationException
see
StringCache::set()

        
On this page

Search results