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.
Constructor
Provide a name (‘Default’ if none provided) and a ManagerInterface instance.
| Parameters: |
|
|---|---|
| Throws ExceptionInvalidArgumentException: | |
Set the default ManagerInterface instance to use when none provided to constructor
| Parameters: | Manager – |
|---|---|
| Return type: | void |
Set session manager
| Parameters: | null|Manager – |
|---|---|
| Return type: | Container |
| Throws : | ExceptionInvalidArgumentException |
Get session storage object
Proxies to ManagerInterface::getStorage()
| Return type: | Storage |
|---|
Create a new container object on which to act
| Return type: | ArrayObject |
|---|
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.
| Parameters: | bool – Whether or not to create the container for the namespace |
|---|---|
| Return type: | Storage|null Returns null only if $createContainer is false |
| Throws : | ExceptionRuntimeException |
Determine whether a given key needs to be expired
Returns true if the key has expired, false otherwise.
| Parameters: | null|string – |
|---|---|
| Return type: | bool |
Expire a key by expiry time
Checks to see if the entire container has expired based on TTL setting, or the individual key.
| Parameters: |
|
|---|---|
| Return type: | bool |
Expire key by session hops
Determines whether the container or an individual key within it has expired based on session hops
| Parameters: |
|
|---|---|
| Return type: | bool |
Store a value within the container
| Parameters: |
|
|---|---|
| Return type: | void |
Determine if the key exists
| Parameters: | string – |
|---|---|
| Return type: | bool |
Retrieve a specific key in the container
| Parameters: | string – |
|---|---|
| Return type: | mixed |
Unset a single key in the container
| Parameters: | string – |
|---|---|
| Return type: | void |
Exchange the current array with another array or object.
| Parameters: | array|object – |
|---|---|
| Return type: | array Returns the old array |
| See : |