interface CacheAdapterInterface (View source)

Methods

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

Set a new enter

bool
setMany(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
setTime(string $key, int $time)

Increase the cache expiration time

int|bool|string
timeOf(string $key)

Retrieves the cache expiration time

bool
forget(string $key)

Remove an entry from the cache

mixed
remember(string $key, int $time, callable $callback)

Retrieve an entry from the cache or store it if it does not exist

int
increment(string $key, int $value = 1)

Increment the value of an entry in the cache

int
decrement(string $key, int $value = 1)

Decrement the value of 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 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 setMany(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 setTime(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)

Remove an entry from the cache

Parameters

string $key

Return Value

bool

mixed remember(string $key, int $time, callable $callback)

Retrieve an entry from the cache or store it if it does not exist

Parameters

string $key
int $time
callable $callback

Return Value

mixed

int increment(string $key, int $value = 1)

Increment the value of an entry in the cache

Parameters

string $key
int $value

Return Value

int

int decrement(string $key, int $value = 1)

Decrement the value of an entry in the cache

Parameters

string $key
int $value

Return Value

int

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