CacheInterface
in
Represents a simple cache interface.
Table of Contents
- get() : mixed|null
- Get a cache item by key.
- remove() : mixed
- Remove a cache key.
- set() : mixed
- Set a cache key value.
Methods
get()
Get a cache item by key.
public
get(string $key) : mixed|null
Parameters
- $key : string
-
Key to retrieve.
Return values
mixed|null —Returns the value or null if not found.
remove()
Remove a cache key.
public
remove(string $key) : mixed
Parameters
- $key : string
-
Key to remove.
Return values
mixed —set()
Set a cache key value.
public
set(string $key, mixed $value, int $ttl) : mixed
Parameters
- $key : string
-
Key to set
- $value : mixed
-
Value to set.
- $ttl : int
-
Number of seconds the item is allowed to live. Set to 0 to allow an unlimited lifetime.