1808. Class

1808.1. Zend\Session\Storage\ArrayStorage

Array session storage

Defines an ArrayObject interface for accessing session storage, with options for setting metadata, locking, and marking as isImmutable.

1808.1.1. Methods

1808.1.1.1. __construct

__construct()

Constructor

Instantiates storage as an ArrayObject, allowing property access. Also sets the initial request access time.

Parameters:
  • array
  • int
  • string

1808.1.1.2. setRequestAccessTime

setRequestAccessTime()

Set the request access time

Parameters:float
Return type:ArrayStorage

1808.1.1.3. getRequestAccessTime

getRequestAccessTime()

Retrieve the request access time

Return type:float

1808.1.1.4. offsetSet

offsetSet()

@param mixed $key

Parameters:mixed
Throws ExceptionRuntimeException:
 

1808.1.1.5. lock

lock()

Lock this storage instance, or a key within it

Parameters:null|int|string
Return type:ArrayStorage

1808.1.1.6. isLocked

isLocked()

Is the object or key marked as locked?

Parameters:null|int|string
Return type:bool

1808.1.1.7. unlock

unlock()

Unlock an object or key marked as locked

Parameters:null|int|string
Return type:ArrayStorage

1808.1.1.8. markImmutable

markImmutable()

Mark the storage container as isImmutable

Return type:ArrayStorage

1808.1.1.9. isImmutable

isImmutable()

Is the storage container marked as isImmutable?

Return type:bool

1808.1.1.10. setMetadata

setMetadata()

Set storage metadata

Metadata is used to store information about the data being stored in the object. Some example use cases include: - Setting expiry data - Maintaining access counts - localizing session storage - etc.

Parameters:
  • string
  • mixed
  • bool – Whether to overwrite or merge array values; by default, merges
Return type:

ArrayStorage

Throws :

ExceptionRuntimeException

1808.1.1.11. getMetadata

getMetadata()

Retrieve metadata for the storage object or a specific metadata key

Returns false if no metadata stored, or no metadata exists for the given key.

Parameters:null|int|string
Return type:mixed

1808.1.1.12. clear

clear()

Clear the storage object or a subkey of the object

Parameters:null|int|string
Return type:ArrayStorage
Throws :ExceptionRuntimeException

1808.1.1.13. fromArray

fromArray()

Load the storage from another array

Overwrites any data that was previously set.

Parameters:array
Return type:ArrayStorage

1808.1.1.14. toArray

toArray()

Cast the object to an array

Returns data only, no metadata.

Return type:array