Zend Framework  1.12
Public Member Functions | Static Public Member Functions | Static Protected Member Functions | List of all members
Zend_Registry Class Reference

Public Member Functions

 __construct ($array=array(), $flags=parent::ARRAY_AS_PROPS)
 Constructs a parent ArrayObject with default ARRAY_AS_PROPS to allow acces as an object.
 
 offsetExists ($index)
 

Static Public Member Functions

static getInstance ()
 Retrieves the default registry instance.
 
static setInstance (Zend_Registry $registry)
 Set the default registry instance to a specified instance.
 
static setClassName ($registryClassName= 'Zend_Registry')
 Set the class name to use for the default registry instance.
 
static _unsetInstance ()
 Unset the default registry instance.
 
static get ($index)
 getter method, basically same as offsetGet().
 
static set ($index, $value)
 setter method, basically same as offsetSet().
 
static isRegistered ($index)
 Returns TRUE if the $index is a named value in the registry, or FALSE if $index was not found in the registry.
 

Static Protected Member Functions

static init ()
 Initialize the default registry instance.
 

Constructor & Destructor Documentation

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

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

Parameters
array$arraydata array
integer$flagsArrayObject flags

Member Function Documentation

static _unsetInstance ( )
static

Unset the default registry instance.

Primarily used in tearDown() in unit tests.

Returns
void
static get (   $index)
static

getter method, basically same as offsetGet().

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
string$index- get the value associated with $index
Returns
mixed
Exceptions
Zend_Exceptionif no entry is registerd for $index.
static getInstance ( )
static

Retrieves the default registry instance.

Returns
Zend_Registry
static init ( )
staticprotected

Initialize the default registry instance.

Returns
void
static isRegistered (   $index)
static

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

Parameters
string$index
Returns
boolean
offsetExists (   $index)
Parameters
string$index
Returns
mixed

Workaround for http://bugs.php.net/bug.php?id=40442 (ZF-960).

static set (   $index,
  $value 
)
static

setter method, basically same as offsetSet().

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
string$indexThe location in the ArrayObject in which to store the value.
mixed$valueThe object to store in the ArrayObject.
Returns
void
static setClassName (   $registryClassName = 'Zend_Registry')
static

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

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

Parameters
string$registryClassName
Returns
void
Exceptions
Zend_Exceptionif the registry is initialized or if the class name is not valid.
See Also
Zend_Loader
static setInstance ( Zend_Registry  $registry)
static

Set the default registry instance to a specified instance.

Parameters
Zend_Registry$registryAn object instance of type Zend_Registry, or a subclass.
Returns
void
Exceptions
Zend_Exceptionif registry is already initialized.