Zend Framework
3.0
|
Session storage container. More...
Public Member Functions | |
__construct ($name= 'Default', Manager $manager=null) | |
Constructor. | |
getName () | |
Get container name. | |
getManager () | |
Get manager instance. | |
offsetSet ($key, $value) | |
Store a value within the container. | |
offsetExists ($key) | |
Determine if the key exists. | |
offsetGet ($key) | |
Retrieve a specific key in the container. | |
offsetUnset ($key) | |
Unset a single key in the container. | |
exchangeArray ($input) | |
Exchange the current array with another array or object. | |
getIterator () | |
Iterate over session container. | |
setExpirationSeconds ($ttl, $vars=null) | |
Set expiration TTL. | |
setExpirationHops ($hops, $vars=null) | |
Set expiration hops for the container, a single key, or set of keys. | |
getArrayCopy () | |
Creates a copy of the specific container name. | |
![]() | |
__construct ($input=[], $flags=self::STD_PROP_LIST, $iteratorClass= 'ArrayIterator') | |
Constructor. | |
__isset ($key) | |
Returns whether the requested key exists. | |
__set ($key, $value) | |
Sets the value at the specified key to value. | |
__unset ($key) | |
Unsets the value at the specified key. | |
& | __get ($key) |
Returns the value at the specified key by reference. | |
append ($value) | |
Appends the value. | |
asort () | |
Sort the entries by value. | |
count () | |
Get the number of public properties in the ArrayObject. | |
exchangeArray ($data) | |
Exchange the array for another one. | |
getArrayCopy () | |
Creates a copy of the ArrayObject. | |
getFlags () | |
Gets the behavior flags. | |
getIterator () | |
Create a new iterator from an ArrayObject instance. | |
getIteratorClass () | |
Gets the iterator classname for the ArrayObject. | |
ksort () | |
Sort the entries by key. | |
natcasesort () | |
Sort an array using a case insensitive "natural order" algorithm. | |
natsort () | |
Sort entries using a "natural order" algorithm. | |
offsetExists ($key) | |
Returns whether the requested key exists. | |
& | offsetGet ($key) |
Returns the value at the specified key. | |
offsetSet ($key, $value) | |
Sets the value at the specified key to value. | |
offsetUnset ($key) | |
Unsets the value at the specified key. | |
serialize () | |
Serialize an ArrayObject. | |
setFlags ($flags) | |
Sets the behavior flags. | |
setIteratorClass ($class) | |
Sets the iterator classname for the ArrayObject. | |
uasort ($function) | |
Sort the entries with a user-defined comparison function and maintain key association. | |
uksort ($function) | |
Sort the entries by keys using a user-defined comparison function. | |
unserialize ($data) | |
Unserialize an ArrayObject. | |
Static Public Member Functions | |
static | setDefaultManager (Manager $manager=null) |
Set the default ManagerInterface instance to use when none provided to constructor. | |
static | getDefaultManager () |
Get the default ManagerInterface instance. | |
Protected Member Functions | |
setManager (Manager $manager=null) | |
Set session manager. | |
getStorage () | |
Get session storage object. | |
createContainer () | |
Create a new container object on which to act. | |
verifyNamespace ($createContainer=true) | |
Verify container namespace. | |
expireKeys ($key=null) | |
Determine whether a given key needs to be expired. | |
expireByExpiryTime (Storage $storage, $name, $key) | |
Expire a key by expiry time. | |
expireByHops (Storage $storage, $name, $key) | |
Expire key by session hops. | |
Protected Attributes | |
$name | |
$manager | |
![]() | |
$storage | |
$flag | |
$iteratorClass | |
$protectedProperties | |
Static Protected Attributes | |
static | $managerDefaultClass = 'Zend\\Session\\SessionManager' |
static | $defaultManager |
Additional Inherited Members | |
![]() | |
const | STD_PROP_LIST = 1 |
Properties of the object have their normal functionality when accessed as list (var_dump, foreach, etc.). | |
const | ARRAY_AS_PROPS = 2 |
Entries can be accessed as properties (read and write). | |
Session storage container.
Allows for interacting with session storage in isolated containers, which may have their own expiries, or even expiries per key in the container. Additionally, expiries may be absolute TTLs or measured in "hops", which are based on how many times the key or container were accessed.
__construct | ( | $name = 'Default' , |
|
Manager | $manager = null |
||
) |
Constructor.
Provide a name ('Default' if none provided) and a ManagerInterface instance.
null | string | $name | |
Manager | $manager |
Exception\InvalidArgumentException |
|
protected |
Create a new container object on which to act.
exchangeArray | ( | $input | ) |
Exchange the current array with another array or object.
array | object | $input |
|
protected |
|
protected |
Expire key by session hops.
Determines whether the container or an individual key within it has expired based on session hops
Storage | $storage | |
string | $name | |
string | $key |
|
protected |
Determine whether a given key needs to be expired.
Returns true if the key has expired, false otherwise.
null | string | $key |
getArrayCopy | ( | ) |
Creates a copy of the specific container name.
|
static |
Get the default ManagerInterface instance.
If none provided, instantiates one of type $managerDefaultClass
Exception\InvalidArgumentException | if invalid manager default class provided |
getIterator | ( | ) |
Iterate over session container.
getManager | ( | ) |
Get manager instance.
getName | ( | ) |
Get container name.
|
protected |
offsetExists | ( | $key | ) |
Determine if the key exists.
string | $key |
offsetGet | ( | $key | ) |
Retrieve a specific key in the container.
string | $key |
offsetSet | ( | $key, | |
$value | |||
) |
Store a value within the container.
string | $key | |
mixed | $value |
offsetUnset | ( | $key | ) |
Unset a single key in the container.
string | $key |
|
static |
Set the default ManagerInterface instance to use when none provided to constructor.
Manager | $manager |
setExpirationHops | ( | $hops, | |
$vars = null |
|||
) |
Set expiration hops for the container, a single key, or set of keys.
int | $hops | |
null | string | array | $vars |
Exception\InvalidArgumentException |
setExpirationSeconds | ( | $ttl, | |
$vars = null |
|||
) |
Set expiration TTL.
Set the TTL for the entire container, a single key, or a set of keys.
int | $ttl | TTL in seconds |
string | array | null | $vars |
Exception\InvalidArgumentException |
|
protected |
Set session manager.
null | Manager | $manager |
Exception\InvalidArgumentException |
|
protected |
Verify container namespace.
Checks to see if a container exists within the Storage object already. If not, one is created; if so, checks to see if it's an ArrayObject. If not, it raises an exception; otherwise, it returns the Storage object.
bool | $createContainer | Whether or not to create the container for the namespace |
Exception\RuntimeException |
|
staticprotected |
|
protected |
|
staticprotected |
|
protected |