DynamoDbStore
Implements
Uses
Properties
$dynamo Aws\...\DynamoDbClient
The DynamoDB client instance.
$table string
The table name.
$keyAttribute string
The name of the attribute that should hold the key.
$valueAttribute string
The name of the attribute that should hold the value.
$expirationAttribute string
The name of the attribute that should hold the expiration timestamp.
$prefix string
A string that should be prepended to keys.
Methods
__construct ( Aws\...\DynamoDbClient $dynamo , $table , $keyAttribute , $valueAttribute , $expirationAttribute , $prefix ) : void
Create a new store instance.
Parameters
- $dynamo Aws\...\DynamoDbClient
- $table string
- $keyAttribute string
- $valueAttribute string
- $expirationAttribute string
- $prefix string
get ( $key ) : mixed
Retrieve an item from the cache by key.
Parameters
- $key string
many ( array $keys ) : array
Retrieve multiple items from the cache by key.
Parameters
- $keys array
isExpired ( array $item , $expiration ) : bool
Determine if the given item is expired.
Parameters
- $item array
- $expiration DateTimeInterface |null
put ( $key , $value , $seconds ) : bool
Store an item in the cache for a given number of seconds.
Parameters
- $key string
- $value mixed
- $seconds int
putMany ( array $values , $seconds ) : bool
Store multiple items in the cache for a given number of $seconds.
Parameters
- $values array
- $seconds int
add ( $key , $value , $seconds ) : bool
Store an item in the cache if the key doesn't exist.
Parameters
- $key string
- $value mixed
- $seconds int
increment ( $key , $value ) : int|bool
Increment the value of an item in the cache.
Parameters
- $key string
- $value mixed
decrement ( $key , $value ) : int|bool
Decrement the value of an item in the cache.
Parameters
- $key string
- $value mixed
forever ( $key , $value ) : bool
Store an item in the cache indefinitely.
Parameters
- $key string
- $value mixed
lock ( $name , $seconds , $owner ) : Lock
Get a lock instance.
Parameters
- $name string
- $seconds int
- $owner string|null
restoreLock ( $name , $owner ) : Lock
Restore a lock instance using the owner identifier.
Parameters
- $name string
- $owner string
forget ( $key ) : bool
Remove an item from the cache.
Parameters
- $key string
flush ( ) : bool
Remove all items from the cache.
toTimestamp ( $seconds ) : int
Get the UNIX timestamp for the given number of seconds.
Parameters
- $seconds int
serialize ( $value ) : mixed
Serialize the value.
Parameters
- $value mixed
unserialize ( $value ) : mixed
Unserialize the value.
Parameters
- $value mixed
type ( $value ) : string
Get the DynamoDB type for the given value.
Parameters
- $value mixed
getPrefix ( ) : string
Get the cache key prefix.
setPrefix ( $prefix ) : void
Set the cache key prefix.
Parameters
- $prefix string
getClient ( ) : Aws\...\DynamoDbClient
Get the DynamoDb Client instance.