AdapterInterface
in
Cache adapter interface
Tags
Table of Contents
Methods
- clear() : AdapterInterface
- Clear all stored values from cache
- decrementItem() : int
- Atomically decrement a counter in cache, creating it at $initial if it doesn't exist
- deleteItem() : AdapterInterface
- Delete a value in cache
- destroy() : AdapterInterface
- Destroy cache resource
- getItem() : mixed
- Get an item from cache
- getItemTtl() : int
- Get the time-to-live for an item in cache
- getTtl() : int
- Get the global time-to-live for the cache object
- hasItem() : bool
- Determine if the item exist in cache
- incrementItem() : int
- Atomically increment a counter in cache, creating it at $initial if it doesn't exist
- saveItem() : AdapterInterface
- Save an item to cache
- setTtl() : AdapterInterface
- Set the global time-to-live for the cache adapter
Methods
clear()
Clear all stored values from cache
public
clear() : AdapterInterface
Return values
AdapterInterfacedecrementItem()
Atomically decrement a counter in cache, creating it at $initial if it doesn't exist
public
decrementItem(string $id[, int $amount = 1 ][, int $initial = 0 ][, int|null $ttl = null ]) : int
Parameters
- $id : string
- $amount : int = 1
- $initial : int = 0
- $ttl : int|null = null
Return values
intdeleteItem()
Delete a value in cache
public
deleteItem(string $id) : AdapterInterface
Parameters
- $id : string
Return values
AdapterInterfacedestroy()
Destroy cache resource
public
destroy() : AdapterInterface
Return values
AdapterInterfacegetItem()
Get an item from cache
public
getItem(string $id[, mixed $default = false ]) : mixed
Parameters
- $id : string
- $default : mixed = false
getItemTtl()
Get the time-to-live for an item in cache
public
getItemTtl(string $id[, int $default = 0 ]) : int
Parameters
- $id : string
- $default : int = 0
Return values
intgetTtl()
Get the global time-to-live for the cache object
public
getTtl() : int
Return values
inthasItem()
Determine if the item exist in cache
public
hasItem(string $id) : bool
Parameters
- $id : string
Return values
boolincrementItem()
Atomically increment a counter in cache, creating it at $initial if it doesn't exist
public
incrementItem(string $id[, int $amount = 1 ][, int $initial = 0 ][, int|null $ttl = null ]) : int
Parameters
- $id : string
- $amount : int = 1
- $initial : int = 0
- $ttl : int|null = null
Return values
intsaveItem()
Save an item to cache
public
saveItem(string $id, mixed $value[, int|null $ttl = null ]) : AdapterInterface
Parameters
- $id : string
- $value : mixed
- $ttl : int|null = null
Return values
AdapterInterfacesetTtl()
Set the global time-to-live for the cache adapter
public
setTtl(int $ttl) : AdapterInterface
Parameters
- $ttl : int