interface Repository implements CacheInterface (View source)

Methods

TCacheValue)
pull(UnitEnum|array|string $key, TCacheValue|TCacheValue $default = null)

Retrieve an item from the cache and delete it.

bool
put(UnitEnum|string $key, mixed $value, DateTimeInterface|DateInterval|int|null $ttl = null)

Store an item in the cache.

bool
add(UnitEnum|string $key, mixed $value, DateTimeInterface|DateInterval|int|null $ttl = null)

Store an item in the cache if the key does not exist.

int|bool
increment(UnitEnum|string $key, mixed $value = 1)

Increment the value of an item in the cache.

int|bool
decrement(UnitEnum|string $key, mixed $value = 1)

Decrement the value of an item in the cache.

bool
forever(UnitEnum|string $key, mixed $value)

Store an item in the cache indefinitely.

TCacheValue
remember(UnitEnum|string $key, DateTimeInterface|DateInterval|Closure|int|null $ttl, Closure $callback)

Get an item from the cache, or execute the given Closure and store the result.

TCacheValue
sear(UnitEnum|string $key, Closure $callback)

Get an item from the cache, or execute the given Closure and store the result forever.

TCacheValue
rememberForever(UnitEnum|string $key, Closure $callback)

Get an item from the cache, or execute the given Closure and store the result forever.

bool
touch(UnitEnum|string $key, DateTimeInterface|DateInterval|int $ttl)

Set the expiration of a cached item.

bool
forget(UnitEnum|string $key)

Remove an item from the cache.

getStore()

Get the cache store implementation.

Details

TCacheValue) pull(UnitEnum|array|string $key, TCacheValue|TCacheValue $default = null)

Retrieve an item from the cache and delete it.

Parameters

UnitEnum|array|string $key
TCacheValue|TCacheValue $default

Return Value

TCacheValue)

bool put(UnitEnum|string $key, mixed $value, DateTimeInterface|DateInterval|int|null $ttl = null)

Store an item in the cache.

Parameters

UnitEnum|string $key
mixed $value
DateTimeInterface|DateInterval|int|null $ttl

Return Value

bool

bool add(UnitEnum|string $key, mixed $value, DateTimeInterface|DateInterval|int|null $ttl = null)

Store an item in the cache if the key does not exist.

Parameters

UnitEnum|string $key
mixed $value
DateTimeInterface|DateInterval|int|null $ttl

Return Value

bool

int|bool increment(UnitEnum|string $key, mixed $value = 1)

Increment the value of an item in the cache.

Parameters

UnitEnum|string $key
mixed $value

Return Value

int|bool

int|bool decrement(UnitEnum|string $key, mixed $value = 1)

Decrement the value of an item in the cache.

Parameters

UnitEnum|string $key
mixed $value

Return Value

int|bool

bool forever(UnitEnum|string $key, mixed $value)

Store an item in the cache indefinitely.

Parameters

UnitEnum|string $key
mixed $value

Return Value

bool

TCacheValue remember(UnitEnum|string $key, DateTimeInterface|DateInterval|Closure|int|null $ttl, Closure $callback)

Get an item from the cache, or execute the given Closure and store the result.

Parameters

UnitEnum|string $key
DateTimeInterface|DateInterval|Closure|int|null $ttl
Closure $callback

Return Value

TCacheValue

TCacheValue sear(UnitEnum|string $key, Closure $callback)

Get an item from the cache, or execute the given Closure and store the result forever.

Parameters

UnitEnum|string $key
Closure $callback

Return Value

TCacheValue

TCacheValue rememberForever(UnitEnum|string $key, Closure $callback)

Get an item from the cache, or execute the given Closure and store the result forever.

Parameters

UnitEnum|string $key
Closure $callback

Return Value

TCacheValue

bool touch(UnitEnum|string $key, DateTimeInterface|DateInterval|int $ttl)

Set the expiration of a cached item.

Parameters

UnitEnum|string $key
DateTimeInterface|DateInterval|int $ttl

Return Value

bool

bool forget(UnitEnum|string $key)

Remove an item from the cache.

Parameters

UnitEnum|string $key

Return Value

bool

Store getStore()

Get the cache store implementation.

Return Value

Store