Class ArrayStorage

Summary

Fully Qualified Name: Laminas\Session\Storage\ArrayStorage
Extends: ArrayObject
Implements: StorageInterface

Description

Array session storage

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

Methods

Name Description Defined By
__construct() Constructor ArrayStorage
__get() Returns the value at the specified key by reference ArrayObject
__isset() Returns whether the requested key exists ArrayObject
__set() Sets the value at the specified key to value ArrayObject
__unset() Unsets the value at the specified key ArrayObject
append() Appends the value ArrayObject
asort() Sort the entries by value ArrayObject
clear() Clear the storage object or a subkey of the object ArrayStorage
count() Get the number of public properties in the ArrayObject ArrayObject
exchangeArray() Exchange the array for another one. ArrayObject
fromArray() Load the storage from another array ArrayStorage
getArrayCopy() Creates a copy of the ArrayObject. ArrayObject
getFlags() Gets the behavior flags. ArrayObject
getIterator() Create a new iterator from an ArrayObject instance ArrayObject
getIteratorClass() Gets the iterator classname for the ArrayObject. ArrayObject
getMetadata() Retrieve metadata for the storage object or a specific metadata key ArrayStorage
getRequestAccessTime() Retrieve the request access time ArrayStorage
isImmutable() Is the storage container marked as isImmutable? ArrayStorage
isLocked() Is the object or key marked as locked? ArrayStorage
ksort() Sort the entries by key ArrayObject
lock() Lock this storage instance, or a key within it ArrayStorage
markImmutable() Mark the storage container as isImmutable ArrayStorage
natcasesort() Sort an array using a case insensitive "natural order" algorithm ArrayObject
natsort() Sort entries using a "natural order" algorithm ArrayObject
offsetExists() Returns whether the requested key exists ArrayObject
offsetGet() Returns the value at the specified key ArrayObject
offsetSet() ArrayStorage
offsetUnset() Unsets the value at the specified key ArrayObject
serialize() Serialize an ArrayObject ArrayObject
setFlags() Sets the behavior flags ArrayObject
setIteratorClass() Sets the iterator classname for the ArrayObject ArrayObject
setMetadata() Set storage metadata ArrayStorage
toArray() Cast the object to an array ArrayStorage
uasort() Sort the entries with a user-defined comparison function and maintain key association ArrayObject
uksort() Sort the entries by keys using a user-defined comparison function ArrayObject
unlock() Unlock an object or key marked as locked ArrayStorage
unserialize() Unserialize an ArrayObject ArrayObject

Method Details

__construct()

Constructor

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

Parameter Name Type Description
$input array
$flags int
$iteratorClass string

Returns:

__get()

Returns the value at the specified key by reference

Parameter Name Type Description
$key mixed

Returns: mixed

__isset()

Returns whether the requested key exists

Parameter Name Type Description
$key mixed

Returns: bool

__set()

Sets the value at the specified key to value

Parameter Name Type Description
$key mixed
$value mixed

Returns: void

__unset()

Unsets the value at the specified key

Parameter Name Type Description
$key mixed

Returns: void

append()

Appends the value

Parameter Name Type Description
$value mixed

Returns: void

asort()

Sort the entries by value

Returns: void

clear()

Clear the storage object or a subkey of the object

Parameter Name Type Description
$key null|int|string

Returns: \ArrayStorage

count()

Get the number of public properties in the ArrayObject

Returns: int

exchangeArray()

Exchange the array for another one.

Parameter Name Type Description
$data array|\ArrayObject

Returns: array

fromArray()

Load the storage from another array

Overwrites any data that was previously set.

Parameter Name Type Description
$array array

Returns: \ArrayStorage

getArrayCopy()

Creates a copy of the ArrayObject.

Returns: array

getFlags()

Gets the behavior flags.

Returns: int

getIterator()

Create a new iterator from an ArrayObject instance

Returns: \Iterator

getIteratorClass()

Gets the iterator classname for the ArrayObject.

Returns: string

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.

Parameter Name Type Description
$key null|int|string

Returns: mixed

getRequestAccessTime()

Retrieve the request access time

Returns: float

isImmutable()

Is the storage container marked as isImmutable?

Returns: bool

isLocked()

Is the object or key marked as locked?

Parameter Name Type Description
$key null|int|string

Returns: bool

ksort()

Sort the entries by key

Returns: void

lock()

Lock this storage instance, or a key within it

Parameter Name Type Description
$key null|int|string

Returns: \ArrayStorage

markImmutable()

Mark the storage container as isImmutable

Returns: \ArrayStorage

natcasesort()

Sort an array using a case insensitive "natural order" algorithm

Returns: void

natsort()

Sort entries using a "natural order" algorithm

Returns: void

offsetExists()

Returns whether the requested key exists

Parameter Name Type Description
$key mixed

Returns: bool

offsetGet()

Returns the value at the specified key

Parameter Name Type Description
$key mixed

Returns: mixed

offsetSet()

Parameter Name Type Description
$key mixed
$value mixed

Returns:

offsetUnset()

Unsets the value at the specified key

Parameter Name Type Description
$key mixed

Returns: void

serialize()

Serialize an ArrayObject

Returns: string

setFlags()

Sets the behavior flags

Parameter Name Type Description
$flags int

Returns: void

setIteratorClass()

Sets the iterator classname for the ArrayObject

Parameter Name Type Description
$class string

Returns: void

setMetadata()

Set storage metadata

Metadata is used to store information about the data being stored in the object. Some example use cases include:

Parameter Name Type Description
$key string
$value mixed
$overwriteArray bool Whether

Returns: \ArrayStorage

toArray()

Cast the object to an array

Parameter Name Type Description
$metaData bool Whether

Returns: array

uasort()

Sort the entries with a user-defined comparison function and maintain key association

Parameter Name Type Description
$function callable

Returns: void

uksort()

Sort the entries by keys using a user-defined comparison function

Parameter Name Type Description
$function callable

Returns: void

unlock()

Unlock an object or key marked as locked

Parameter Name Type Description
$key null|int|string

Returns: \ArrayStorage

unserialize()

Unserialize an ArrayObject

Parameter Name Type Description
$data string

Returns: void

Top