Session/Namespace.php
LICENSE
This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Session
- Since
- Preview Release 0.2
- Version
- $Id: Namespace.php 24593 2012-01-05 20:35:02Z matthew $
\Zend_Session_Namespace
- Implements
- Parent(s)
- \Zend_Session_Abstract
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Constants
SINGLE_INSTANCE
= true
_THROW_NOT_WRITABLE_MSG
= 'Zend_Session is currently marked as read-only.'- Inherited_from
- \Zend_Session_Abstract::_THROW_NOT_WRITABLE_MSG
_THROW_NOT_READABLE_MSG
= 'Zend_Session is not marked as readable.'- Inherited_from
- \Zend_Session_Abstract::_THROW_NOT_READABLE_MSG
Properties

array $_expiringData = array()array()Details- Type
- array
- Inherited_from
- \Zend_Session_Abstract::$$_expiringData

string $_namespace = "Default""Default"Details- Type
- string

array $_namespaceLocks = array()array()Details- Type
- array

bool $_readable = falsefalseDetails- Type
- bool
- Inherited_from
- \Zend_Session_Abstract::$$_readable

array $_singleInstances = array()array()Details- Type
- array

bool $_writable = falsefalseDetails- Type
- bool
- Inherited_from
- \Zend_Session_Abstract::$$_writable
Methods

__construct(string $namespace = 'Default', bool $singleInstance = false) : void__construct() - Returns an instance object bound to a particular, isolated section of the session, identified by $namespace name (defaulting to 'Default').
The optional argument $singleInstance will prevent construction of additional instance objects acting as accessors to this $namespace.
| Name | Type | Description |
|---|---|---|
| $namespace | string |
|
| $singleInstance | bool |
|

__get(string $name) : mixed__get() - method to get a variable in this object's current namespace
| Name | Type | Description |
|---|---|---|
| $name | string |
|
| Type | Description |
|---|---|
| mixed |

__isset(string $name) : bool__isset() - determine if a variable in this object's namespace is set
| Name | Type | Description |
|---|---|---|
| $name | string |
|
| Type | Description |
|---|---|
| bool |

__set(string $name, mixed $value) : true__set() - method to set a variable/value in this object's namespace
| Name | Type | Description |
|---|---|---|
| $name | string |
|
| $value | mixed |
|
| Type | Description |
|---|---|
| true |
| Exception | Description |
|---|---|
| \Zend_Session_Exception |

__unset(string $name) : true__unset() - unset a variable in this object's namespace.
| Name | Type | Description |
|---|---|---|
| $name | string |
|
| Type | Description |
|---|---|
| true |

_namespaceGet(string $namespace, string $name = null) : mixednamespaceGet() - Get $name variable from $namespace, returning by reference.
Inherited from: \Zend_Session_Abstract::_namespaceGet()| Name | Type | Description |
|---|---|---|
| $namespace | string | |
| $name | string |
| Type | Description |
|---|---|
| mixed |

_namespaceGetAll(string $namespace) : mixednamespaceGetAll() - Get an array containing $namespace, including expiring data.
Inherited from: \Zend_Session_Abstract::_namespaceGetAll()| Name | Type | Description |
|---|---|---|
| $namespace | string |
| Type | Description |
|---|---|
| mixed |

_namespaceIsset(string $namespace, string $name = null) : boolnamespaceIsset() - check to see if a namespace or a variable within a namespace is set
Inherited from: \Zend_Session_Abstract::_namespaceIsset()| Name | Type | Description |
|---|---|---|
| $namespace | string | |
| $name | string |
| Type | Description |
|---|---|
| bool |

_namespaceUnset(string $namespace, string $name = null) : voidnamespaceUnset() - unset a namespace or a variable within a namespace
Inherited from: \Zend_Session_Abstract::_namespaceUnset()| Name | Type | Description |
|---|---|---|
| $namespace | string | |
| $name | string |
| Exception | Description |
|---|---|
| \Zend_Session_Exception |

apply(string | array $callback) : voidapply() - enables applying user-selected function, such as array_merge() to the namespace Parameters following the $callback argument are passed to the callback function.
Caveat: ignores members expiring now.
Example: $namespace->apply('array_merge', array('tree' => 'apple', 'fruit' => 'peach'), array('flower' => 'rose')); $namespace->apply('count');
| Name | Type | Description |
|---|---|---|
| $callback | string | array |
|

applySet(string | array $callback) : voidapplySet() - enables applying user-selected function, and sets entire namespace to the result Result of $callback must be an array.
Parameters following the $callback argument are passed to the callback function. Caveat: ignores members expiring now.
Example: $namespace->applySet('array_merge', array('tree' => 'apple', 'fruit' => 'peach'), array('flower' => 'rose'));
| Name | Type | Description |
|---|---|---|
| $callback | string | array |
|

getIterator() : \ArrayObjectgetIterator() - return an iteratable object for use in foreach and the like, this completes the IteratorAggregate interface
| Type | Description |
|---|---|
| \ArrayObject | - iteratable container of the namespace contents |

isLocked() : boolisLocked() - return lock status, true if, and only if, read-only
| Type | Description |
|---|---|
| bool |

resetSingleInstance(string $namespaceName = null) : nullresetSingleInstance()
| Name | Type | Description |
|---|---|---|
| $namespaceName | string |
| Type | Description |
|---|---|
| null |

setExpirationHops(int $hops, mixed $variables = null, boolean $hopCountOnUsageOnly = false) : voidsetExpirationHops() - expire the namespace, or specific variables after a specified number of page hops
| Name | Type | Description |
|---|---|---|
| $hops | int |
|
| $variables | mixed |
|
| $hopCountOnUsageOnly | boolean |
|
| Exception | Description |
|---|---|
| \Zend_Session_Exception |

setExpirationSeconds(int $seconds, mixed $variables = null) : voidsetExpirationSeconds() - expire the namespace, or specific variables after a specified number of seconds
| Name | Type | Description |
|---|---|---|
| $seconds | int |
|
| $variables | mixed |
|
| Exception | Description |
|---|---|
| \Zend_Session_Exception |