43. Class

43.1. Zend\Cache\Storage\Adapter\Memory

43.1.1. Methods

43.1.1.1. setOptions

setOptions()

Set options.

Parameters:array|Traversable|MemoryOptions
Return type:Memory
See :

43.1.1.2. getOptions

getOptions()

Get options.

Return type:MemoryOptions
See :

43.1.1.3. getTotalSpace

getTotalSpace()

Get total space in bytes

Return type:int|float

43.1.1.4. getAvailableSpace

getAvailableSpace()

Get available space in bytes

Return type:int|float

43.1.1.5. getIterator

getIterator()

Get the storage iterator

Return type:KeyListIterator

43.1.1.6. flush

flush()

Flush the whole storage

Return type:bool

43.1.1.7. clearExpired

clearExpired()

Remove expired items

Return type:bool

43.1.1.8. clearByNamespace

clearByNamespace()

43.1.1.9. clearByPrefix

clearByPrefix()

Remove items matching given prefix

Parameters:string
Return type:bool

43.1.1.10. setTags

setTags()

Set tags to an item by given key. An empty array will remove all tags.

Parameters:
  • string
  • string[]
Return type:

bool

43.1.1.11. getTags

getTags()

Get tags of an item by given key

Parameters:string
Return type:string[]|FALSE

43.1.1.12. clearByTags

clearByTags()

Remove items matching given tags.

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

Parameters:
  • string[]
  • bool
Return type:

bool

43.1.1.13. internalGetItem

internalGetItem()

Internal method to get an item.

Parameters:
  • string
  • bool
  • mixed
Return type:

mixed Data on success, null on failure

Throws :

ExceptionExceptionInterface

43.1.1.14. internalGetItems

internalGetItems()

Internal method to get multiple items.

Parameters:array
Return type:array Associative array of keys and values
Throws :ExceptionExceptionInterface

43.1.1.15. internalHasItem

internalHasItem()

Internal method to test if an item exists.

Parameters:string
Return type:bool

43.1.1.16. internalHasItems

internalHasItems()

Internal method to test multiple items.

Parameters:array
Return type:array Array of found keys

43.1.1.17. internalGetMetadata

internalGetMetadata()

Get metadata of an item.

Parameters:string
Return type:array|bool Metadata on success, false on failure
Throws :ExceptionExceptionInterface @triggers getMetadata.pre(PreEvent)

@triggers getMetadata.post(PostEvent) @triggers getMetadata.exception(ExceptionEvent)

43.1.1.18. internalSetItem

internalSetItem()

Internal method to store an item.

Parameters:
  • string
  • mixed
Return type:

bool

Throws :

ExceptionExceptionInterface

43.1.1.19. internalSetItems

internalSetItems()

Internal method to store multiple items.

Parameters:array
Return type:array Array of not stored keys
Throws :ExceptionExceptionInterface

43.1.1.20. internalAddItem

internalAddItem()

Add an item.

Parameters:
  • string
  • mixed
Return type:

bool

Throws :

ExceptionExceptionInterface

43.1.1.21. internalAddItems

internalAddItems()

Internal method to add multiple items.

Parameters:array
Return type:array Array of not stored keys
Throws :ExceptionExceptionInterface

43.1.1.22. internalReplaceItem

internalReplaceItem()

Internal method to replace an existing item.

Parameters:
  • string
  • mixed
Return type:

bool

Throws :

ExceptionExceptionInterface

43.1.1.23. internalReplaceItems

internalReplaceItems()

Internal method to replace multiple existing items.

Parameters:array
Return type:array Array of not stored keys
Throws :ExceptionExceptionInterface

43.1.1.24. internalTouchItem

internalTouchItem()

Internal method to reset lifetime of an item

Parameters:string
Return type:bool
Throws :ExceptionExceptionInterface

43.1.1.25. internalRemoveItem

internalRemoveItem()

Internal method to remove an item.

Parameters:string
Return type:bool
Throws :ExceptionExceptionInterface

43.1.1.26. internalIncrementItem

internalIncrementItem()

Internal method to increment an item.

Parameters:
  • string
  • int
Return type:

int|bool The new value on success, false on failure

Throws :

ExceptionExceptionInterface

43.1.1.27. internalDecrementItem

internalDecrementItem()

Internal method to decrement an item.

Parameters:
  • string
  • int
Return type:

int|bool The new value on success, false on failure

Throws :

ExceptionExceptionInterface

43.1.1.28. internalGetCapabilities

internalGetCapabilities()

Internal method to get capabilities of this adapter

Return type:Capabilities

43.1.1.29. hasAvailableSpace

hasAvailableSpace()

Has space available to store items?

Return type:bool