Documentation

CacheDriver

Cache driver interface.

Table of Contents

Methods

delete()  : bool
Delete cache items by id or tag.
deleteExpired()  : void
Deletes all expired cache items.
find()  : array<string|int, mixed>
Find all of the cache ids for a given tag.
get()  : mixed
Get a cache item.
set()  : mixed
Sets a cache item to the given data, tags, and lifetime.

Methods

delete()

Delete cache items by id or tag.

public delete(string|true $id[, bool $tag = false ]) : bool
Parameters
$id : string|true

true to delete all items

$tag : bool = false

set true to delete by tag

Return values
bool

deleteExpired()

Deletes all expired cache items.

public deleteExpired() : void

find()

Find all of the cache ids for a given tag.

public find(string $tag) : array<string|int, mixed>
Parameters
$tag : string
Return values
array<string|int, mixed> —

[ id => data ]

get()

Get a cache item.

public get(string $id) : mixed

Return NULL if the cache item is not found.

Parameters
$id : string

set()

Sets a cache item to the given data, tags, and lifetime.

public set(string $id, mixed $data[, array<string|int, mixed> $tags = null ][, int $lifetime = 0 ]) : mixed
Parameters
$id : string
$data : mixed
$tags : array<string|int, mixed> = null
$lifetime : int = 0

in seconds

On this page

Search results