__construct()
exchangeArray()
getArrayCopy()
getDefaultManager()
getIterator()
getManager()
getName()
offsetExists()
offsetGet()
offsetSet()
offsetUnset()
setDefaultManager()
setExpirationHops()
setExpirationSeconds()
createContainer()
expireByExpiryTime()
expireByHops()
expireKeys()
getStorage()
setManager()
verifyNamespace()
$defaultManager
$manager
$managerDefaultClass
$name
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(null | string $name, \Zend\Session\ManagerInterface $manager)
Provide a name ('Default' if none provided) and a ManagerInterface instance.
nullstring
\Zend\Session\ManagerInterface
\Zend\Session\Exception\InvalidArgumentException |
---|
exchangeArray(array | object $input) : array
see | \Zend\Stdlib\ArrayObject::exchangeArray() |
---|
arrayobject
array
Returns the old arraygetArrayCopy() : array
array
getDefaultManager() : \Zend\Session\ManagerInterface
If none provided, instantiates one of type $managerDefaultClass
\Zend\Session\Exception\InvalidArgumentException |
if invalid manager default class provided |
---|
getIterator() : \Iterator
\Iterator
getName() : string
string
offsetExists(string $key) : bool
string
bool
offsetGet(string $key) : mixed
string
mixed
offsetSet(string $key, mixed $value) : void
string
mixed
offsetUnset(string $key) : void
string
setDefaultManager(\Zend\Session\ManagerInterface $manager) : void
\Zend\Session\ManagerInterface
setExpirationHops(int $hops, null | string | array $vars) : \Zend\Session\Container
int
nullstringarray
\Zend\Session\Exception\InvalidArgumentException |
---|
setExpirationSeconds(int $ttl, string | array | null $vars) : \Zend\Session\Container
Set the TTL for the entire container, a single key, or a set of keys.
int
TTL in seconds
stringarraynull
\Zend\Session\Exception\InvalidArgumentException |
---|
expireByExpiryTime(\Zend\Session\Storage\StorageInterface $storage, string $name, string $key) : bool
Checks to see if the entire container has expired based on TTL setting, or the individual key.
string
Container name
string
Key in container to check
bool
expireByHops(\Zend\Session\Storage\StorageInterface $storage, string $name, string $key) : bool
Determines whether the container or an individual key within it has expired based on session hops
string
string
bool
expireKeys(null | string $key) : bool
Returns true if the key has expired, false otherwise.
nullstring
bool
setManager(\Zend\Session\ManagerInterface $manager) : \Zend\Session\Container
null\Zend\Session\ManagerInterface
\Zend\Session\Exception\InvalidArgumentException |
---|
verifyNamespace(bool $createContainer) : \Zend\Session\Storage\StorageInterface | null
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
Whether or not to create the container for the namespace
\Zend\Session\Exception\RuntimeException |
---|
\Zend\Session\Storage\StorageInterface
null
Returns null only if $createContainer is false$defaultManager : \Zend\Session\ManagerInterface
$managerDefaultClass : string
$name : string