Zend Framework  3.0
Public Member Functions | Protected Attributes | List of all members
BlackHole Class Reference

Public Member Functions

 __construct ($options=null)
 Constructor.
 
 setOptions ($options)
 Set options.
 
 getOptions ()
 Get options.
 
 getItem ($key, &$success=null, &$casToken=null)
 Get an item.
 
 getItems (array $keys)
 Get multiple items.
 
 hasItem ($key)
 Test if an item exists.
 
 hasItems (array $keys)
 Test multiple items.
 
 getMetadata ($key)
 Get metadata of an item.
 
 getMetadatas (array $keys)
 Get multiple metadata.
 
 setItem ($key, $value)
 Store an item.
 
 setItems (array $keyValuePairs)
 Store multiple items.
 
 addItem ($key, $value)
 Add an item.
 
 addItems (array $keyValuePairs)
 Add multiple items.
 
 replaceItem ($key, $value)
 Replace an existing item.
 
 replaceItems (array $keyValuePairs)
 Replace multiple existing items.
 
 checkAndSetItem ($token, $key, $value)
 Set an item only if token matches.
 
 touchItem ($key)
 Reset lifetime of an item.
 
 touchItems (array $keys)
 Reset lifetime of multiple items.
 
 removeItem ($key)
 Remove an item.
 
 removeItems (array $keys)
 Remove multiple items.
 
 incrementItem ($key, $value)
 Increment an item.
 
 incrementItems (array $keyValuePairs)
 Increment multiple items.
 
 decrementItem ($key, $value)
 Decrement an item.
 
 decrementItems (array $keyValuePairs)
 Decrement multiple items.
 
 getCapabilities ()
 Capabilities of this storage.
 
 getAvailableSpace ()
 Get available space in bytes.
 
 clearByNamespace ($namespace)
 Remove items of given namespace.
 
 clearByPrefix ($prefix)
 Remove items matching given prefix.
 
 clearExpired ()
 Remove expired items.
 
 flush ()
 Flush the whole storage.
 
 getIterator ()
 Get the storage iterator.
 
 optimize ()
 Optimize the storage.
 
 setTags ($key, array $tags)
 Set tags to an item by given key.
 
 getTags ($key)
 Get tags of an item by given key.
 
 clearByTags (array $tags, $disjunction=false)
 Remove items matching given tags.
 
 getTotalSpace ()
 Get total space in bytes.
 

Protected Attributes

 $capabilities = null
 
 $capabilityMarker
 
 $options
 

Constructor & Destructor Documentation

__construct (   $options = null)

Constructor.

Parameters
null | array | \Traversable | AdapterOptions$options

Member Function Documentation

addItem (   $key,
  $value 
)

Add an item.

Parameters
string$key
mixed$value
Returns
bool

Implements StorageInterface.

addItems ( array  $keyValuePairs)

Add multiple items.

Parameters
array$keyValuePairs
Returns
array Array of not stored keys

Implements StorageInterface.

checkAndSetItem (   $token,
  $key,
  $value 
)

Set an item only if token matches.

It uses the token received from getItem() to check if the item has changed before overwriting it.

Parameters
mixed$token
string$key
mixed$value
Returns
bool

Implements StorageInterface.

clearByNamespace (   $namespace)

Remove items of given namespace.

Parameters
string$namespace
Returns
bool

Implements ClearByNamespaceInterface.

clearByPrefix (   $prefix)

Remove items matching given prefix.

Parameters
string$prefix
Returns
bool

Implements ClearByPrefixInterface.

clearByTags ( array  $tags,
  $disjunction = false 
)

Remove items matching given tags.

If $disjunction only one of the given tags must match else all given tags must match.

Parameters
string[]$tags
bool$disjunction
Returns
bool

Implements TaggableInterface.

clearExpired ( )

Remove expired items.

Returns
bool

Implements ClearExpiredInterface.

decrementItem (   $key,
  $value 
)

Decrement an item.

Parameters
string$key
int$value
Returns
int|bool The new value on success, false on failure

Implements StorageInterface.

decrementItems ( array  $keyValuePairs)

Decrement multiple items.

Parameters
array$keyValuePairs
Returns
array Associative array of keys and new values

Implements StorageInterface.

flush ( )

Flush the whole storage.

Returns
bool

Implements FlushableInterface.

getAvailableSpace ( )

Get available space in bytes.

Returns
int|float

Implements AvailableSpaceCapableInterface.

getCapabilities ( )

Capabilities of this storage.

Returns
Capabilities

Implements StorageInterface.

getItem (   $key,
$success = null,
$casToken = null 
)

Get an item.

Parameters
string$key
bool$success
mixed$casToken
Returns
mixed Data on success, null on failure

Implements StorageInterface.

getItems ( array  $keys)

Get multiple items.

Parameters
array$keys
Returns
array Associative array of keys and values

Implements StorageInterface.

getIterator ( )

Get the storage iterator.

Returns
KeyListIterator
getMetadata (   $key)

Get metadata of an item.

Parameters
string$key
Returns
array|bool Metadata on success, false on failure

Implements StorageInterface.

getMetadatas ( array  $keys)

Get multiple metadata.

Parameters
array$keys
Returns
array Associative array of keys and metadata

Implements StorageInterface.

getOptions ( )

Get options.

Returns
AdapterOptions

Implements StorageInterface.

getTags (   $key)

Get tags of an item by given key.

Parameters
string$key
Returns
string[]|FALSE

Implements TaggableInterface.

getTotalSpace ( )

Get total space in bytes.

Returns
int|float

Implements TotalSpaceCapableInterface.

hasItem (   $key)

Test if an item exists.

Parameters
string$key
Returns
bool

Implements StorageInterface.

hasItems ( array  $keys)

Test multiple items.

Parameters
array$keys
Returns
array Array of found keys

Implements StorageInterface.

incrementItem (   $key,
  $value 
)

Increment an item.

Parameters
string$key
int$value
Returns
int|bool The new value on success, false on failure

Implements StorageInterface.

incrementItems ( array  $keyValuePairs)

Increment multiple items.

Parameters
array$keyValuePairs
Returns
array Associative array of keys and new values

Implements StorageInterface.

optimize ( )

Optimize the storage.

Returns
bool

Implements OptimizableInterface.

removeItem (   $key)

Remove an item.

Parameters
string$key
Returns
bool

Implements StorageInterface.

removeItems ( array  $keys)

Remove multiple items.

Parameters
array$keys
Returns
array Array of not removed keys

Implements StorageInterface.

replaceItem (   $key,
  $value 
)

Replace an existing item.

Parameters
string$key
mixed$value
Returns
bool

Implements StorageInterface.

replaceItems ( array  $keyValuePairs)

Replace multiple existing items.

Parameters
array$keyValuePairs
Returns
array Array of not stored keys

Implements StorageInterface.

setItem (   $key,
  $value 
)

Store an item.

Parameters
string$key
mixed$value
Returns
bool

Implements StorageInterface.

setItems ( array  $keyValuePairs)

Store multiple items.

Parameters
array$keyValuePairs
Returns
array Array of not stored keys

Implements StorageInterface.

setOptions (   $options)

Set options.

Parameters
array | \Traversable | AdapterOptions$options
Returns
StorageInterface Fluent interface

Implements StorageInterface.

setTags (   $key,
array  $tags 
)

Set tags to an item by given key.

An empty array will remove all tags.

Parameters
string$key
string[]$tags
Returns
bool

Implements TaggableInterface.

touchItem (   $key)

Reset lifetime of an item.

Parameters
string$key
Returns
bool

Implements StorageInterface.

touchItems ( array  $keys)

Reset lifetime of multiple items.

Parameters
array$keys
Returns
array Array of not updated keys

Implements StorageInterface.

Member Data Documentation

$capabilities = null
protected
$capabilityMarker
protected
$options
protected