Documentation

ChainCache extends AbstractCache
in package

Cache class for PSR-16 compatible "Simple Cache" implementation using chained cache adapters.

Table of Contents

Properties

$caches  : array<string|int, CacheInterface>
$count  : int
$defaultLifetime  : int|null
$miss  : stdClass
$namespace  : string
$validation  : bool

Methods

__construct()  : mixed
Chain Cache constructor.
clear()  : bool
delete()  : bool
deleteMultiple()  : bool
doClear()  : bool
doDelete()  : mixed
doDeleteMultiple()  : mixed
doGet()  : mixed
doGetMultiple()  : mixed
doHas()  : mixed
doSet()  : mixed
doSetMultiple()  : mixed
get()  : mixed|null
getMultiple()  : iterable<string|int, mixed>
has()  : bool
set()  : bool
setMultiple()  : bool
setValidation()  : void
convertTtl()  : int|null
getDefaultLifetime()  : int|null
getNamespace()  : string
init()  : void
Always call from constructor.
validateKey()  : void
validateKeys()  : void

Properties

$defaultLifetime

private int|null $defaultLifetime = null

Methods

__construct()

Chain Cache constructor.

public __construct(array<string|int, mixed> $caches[, null|int|DateInterval $defaultLifetime = null ]) : mixed
Parameters
$caches : array<string|int, mixed>
$defaultLifetime : null|int|DateInterval = null
Tags
throws
InvalidArgumentException

clear()

public clear() : bool
Return values
bool

deleteMultiple()

public deleteMultiple(iterable<string|int, mixed> $keys) : bool
Parameters
$keys : iterable<string|int, mixed>
Tags
throws
InvalidArgumentException
Return values
bool

doClear()

public doClear() : bool
Tags
inheritdoc
Return values
bool

doDelete()

public doDelete(mixed $key) : mixed
Parameters
$key : mixed
Tags
inheritdoc

doDeleteMultiple()

public doDeleteMultiple(mixed $keys) : mixed
Parameters
$keys : mixed
Tags
inheritdoc

doGet()

public doGet(mixed $key, mixed $miss) : mixed
Parameters
$key : mixed
$miss : mixed
Tags
inheritdoc

doGetMultiple()

public doGetMultiple(mixed $keys, mixed $miss) : mixed
Parameters
$keys : mixed
$miss : mixed
Tags
inheritdoc

doHas()

public doHas(mixed $key) : mixed
Parameters
$key : mixed
Tags
inheritdoc

doSet()

public doSet(mixed $key, mixed $value, mixed $ttl) : mixed
Parameters
$key : mixed
$value : mixed
$ttl : mixed
Tags
inheritdoc

doSetMultiple()

public doSetMultiple(mixed $values, mixed $ttl) : mixed
Parameters
$values : mixed
$ttl : mixed
Tags
inheritdoc

get()

public get(string $key[, mixed|null $default = null ]) : mixed|null
Parameters
$key : string
$default : mixed|null = null
Tags
throws
InvalidArgumentException
Return values
mixed|null

getMultiple()

public getMultiple(iterable<string|int, mixed> $keys[, mixed|null $default = null ]) : iterable<string|int, mixed>
Parameters
$keys : iterable<string|int, mixed>
$default : mixed|null = null
Tags
throws
InvalidArgumentException
Return values
iterable<string|int, mixed>

set()

public set(string $key, mixed $value[, null|int|DateInterval $ttl = null ]) : bool
Parameters
$key : string
$value : mixed
$ttl : null|int|DateInterval = null
Tags
throws
InvalidArgumentException
Return values
bool

setMultiple()

public setMultiple(iterable<string|int, mixed> $values[, null|int|DateInterval $ttl = null ]) : bool
Parameters
$values : iterable<string|int, mixed>
$ttl : null|int|DateInterval = null
Tags
throws
InvalidArgumentException
Return values
bool

setValidation()

public setValidation(bool $validation) : void
Parameters
$validation : bool

convertTtl()

protected convertTtl(null|int|DateInterval $ttl) : int|null
Parameters
$ttl : null|int|DateInterval
Tags
throws
InvalidArgumentException
Return values
int|null

getDefaultLifetime()

protected getDefaultLifetime() : int|null
Return values
int|null

getNamespace()

protected getNamespace() : string
Return values
string

init()

Always call from constructor.

protected init([string $namespace = '' ][, null|int|DateInterval $defaultLifetime = null ]) : void
Parameters
$namespace : string = ''
$defaultLifetime : null|int|DateInterval = null
Tags
throws
InvalidArgumentException

        
On this page

Search results