class Illuminate / Cache / DynamoDbStore

DynamoDbStore

Implements

Uses

Properties

protected

$dynamo Aws\...\DynamoDbClient

The DynamoDB client instance.

Default: null
protected

$table string

The table name.

Default: null
protected

$keyAttribute string

The name of the attribute that should hold the key.

Default: null
protected

$valueAttribute string

The name of the attribute that should hold the value.

Default: null
protected

$expirationAttribute string

The name of the attribute that should hold the expiration timestamp.

Default: null
protected

$prefix string

A string that should be prepended to keys.

Default: null

Methods

public

__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
public

get ( $key ) : mixed

Retrieve an item from the cache by key.

Parameters

  • $key string
public

many ( array $keys ) : array

Retrieve multiple items from the cache by key.

Parameters

  • $keys array
protected

isExpired ( array $item , $expiration ) : bool

Determine if the given item is expired.

Parameters

public

put ( $key , $value , $seconds ) : bool

Store an item in the cache for a given number of seconds.

Parameters

  • $key string
  • $value mixed
  • $seconds int
public

putMany ( array $values , $seconds ) : bool

Store multiple items in the cache for a given number of seconds.

Parameters

  • $values array
  • $seconds int
public

add ( $key , $value , $seconds ) : bool

Store an item in the cache if the key doesn't exist.

Parameters

  • $key string
  • $value mixed
  • $seconds int
public

increment ( $key , $value ) : int|bool

Increment the value of an item in the cache.

Parameters

  • $key string
  • $value mixed
public

decrement ( $key , $value ) : int|bool

Decrement the value of an item in the cache.

Parameters

  • $key string
  • $value mixed
public

forever ( $key , $value ) : bool

Store an item in the cache indefinitely.

Parameters

  • $key string
  • $value mixed
public

lock ( $name , $seconds , $owner ) : Lock

Get a lock instance.

Parameters

  • $name string
  • $seconds int
  • $owner string|null
public

restoreLock ( $name , $owner ) : Lock

Restore a lock instance using the owner identifier.

Parameters

  • $name string
  • $owner string
public

forget ( $key ) : bool

Remove an item from the cache.

Parameters

  • $key string
public

flush ( ) : bool

Remove all items from the cache.

protected

toTimestamp ( $seconds ) : int

Get the UNIX timestamp for the given number of seconds.

Parameters

  • $seconds int
protected

serialize ( $value ) : mixed

Serialize the value.

Parameters

  • $value mixed
protected

unserialize ( $value ) : mixed

Unserialize the value.

Parameters

  • $value mixed
protected

type ( $value ) : string

Get the DynamoDB type for the given value.

Parameters

  • $value mixed
public

getPrefix ( ) : string

Get the cache key prefix.

public

setPrefix ( $prefix ) : void

Set the cache key prefix.

Parameters

  • $prefix string
public

getClient ( ) : Aws\...\DynamoDbClient

Get the DynamoDb Client instance.