interface CacheAdapterInterface (View source)

Methods

bool
add(string $key, mixed $data, int|null $time = null)

Add new enter in the cache system

bool
set(string $key, mixed $data, int|null $time = null)

Set a new enter

bool
addMany(array $data)

Add many item

bool
forever(string $key, mixed $data)

Adds a cache that will persist

bool
push(string $key, array $data)

Add new enter in the cache system

mixed
get(string $key, mixed $default = null)

Retrieve an entry in the cache

bool
addTime(string $key, int $time)

Increase the cache expiration time

int|bool|string
timeOf(string $key)

Retrieves the cache expiration time

bool
forget(string $key)

Delete an entry in the cache

bool
has(string $key)

Check for an entry in the cache.

bool
expired(string $key)

Check if the cache has expired

void
clear()

Clear all cache

Details

bool add(string $key, mixed $data, int|null $time = null)

Add new enter in the cache system

Parameters

string $key
mixed $data
int|null $time

Return Value

bool

bool set(string $key, mixed $data, int|null $time = null)

Set a new enter

Parameters

string $key
mixed $data
int|null $time

Return Value

bool

bool addMany(array $data)

Add many item

Parameters

array $data

Return Value

bool

bool forever(string $key, mixed $data)

Adds a cache that will persist

Parameters

string $key

The cache key

mixed $data

Return Value

bool

bool push(string $key, array $data)

Add new enter in the cache system

Parameters

string $key

The cache key

array $data

Return Value

bool

mixed get(string $key, mixed $default = null)

Retrieve an entry in the cache

Parameters

string $key
mixed $default

Return Value

mixed

bool addTime(string $key, int $time)

Increase the cache expiration time

Parameters

string $key
int $time

Return Value

bool

int|bool|string timeOf(string $key)

Retrieves the cache expiration time

Parameters

string $key

Return Value

int|bool|string

bool forget(string $key)

Delete an entry in the cache

Parameters

string $key

Return Value

bool

bool has(string $key)

Check for an entry in the cache.

Parameters

string $key

Return Value

bool

bool expired(string $key)

Check if the cache has expired

Parameters

string $key

Return Value

bool

void clear()

Clear all cache

Return Value

void