Generic storage class helps to manage global data.

category Zend
package Zend_Registry
copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
license New BSD License

 Methods

Constructs a parent ArrayObject with default ARRAY_AS_PROPS to allow acces as an object

__construct(array $array = array(), integer $flags = parent::ARRAY_AS_PROPS

Parameters

$array

array

data array

$flags

integer

ArrayObject flags

Unset the default registry instance.

_unsetInstance() 
Static

Primarily used in tearDown() in unit tests.

returns void

getter method, basically same as offsetGet().

get(string $index) : mixed
Static

This method can be called from an object of type Zend_Registry, or it can be called statically. In the latter case, it uses the default static instance stored in the class.

Parameters

$index

string
  • get the value associated with $index

Exceptions

\Zend_Exception if no entry is registered for $index.

Returns

mixed

Retrieves the default registry instance.

getInstance() : \Zend_Registry
Static

Returns

\Zend_Registry

Returns TRUE if the $index is a named value in the registry, or FALSE if $index was not found in the registry.

isRegistered(string $index) : boolean
Static

Parameters

$index

string

Returns

boolean

offsetExists()

offsetExists(string $index) 
returns mixed Workaround for http://bugs.php.net/bug.php?id=40442 (ZF-960).

Parameters

$index

string

setter method, basically same as offsetSet().

set(string $index, mixed $value) : void
Static

This method can be called from an object of type Zend_Registry, or it can be called statically. In the latter case, it uses the default static instance stored in the class.

Parameters

$index

string

The location in the ArrayObject in which to store the value.

$value

mixed

The object to store in the ArrayObject.

Set the class name to use for the default registry instance.

setClassName(string $registryClassName = 'Zend_Registry') : void
Static

Does not affect the currently initialized instance, it only applies for the next time you instantiate.

Parameters

$registryClassName

string

Exceptions

\Zend_Exception if the registry is initialized or if the class name is not valid.

Set the default registry instance to a specified instance.

setInstance(\Zend_Registry $registry) : void
Static

Parameters

$registry

\Zend_Registry

An object instance of type Zend_Registry, or a subclass.

Exceptions

\Zend_Exception if registry is already initialized.

Initialize the default registry instance.

init() : void
Static

 Properties

 

Registry object provides storage for shared objects.

$_registry : \Zend_Registry

Default

null
Static
 

Class name of the singleton registry object.

$_registryClassName : string

Default

'Zend_Registry'
Static