## API Documentation

# Registry.php

Zend Framework

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-2011 Zend Technologies USA Inc. (http://www.zend.com)
license
  New BSD License
package
  Zend_Registry
version
  $Id: Registry.php 23775 2011-03-01 17:25:24Z ralph $

## \Zend_Registry
jump to top

Generic storage class helps to manage global data.

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

### Properties

`\Zend_Registry $_registry= 'null'`
static

Registry object provides storage for shared objects.

Default value `null` Details

Type
  \Zend_Registry

`string $_registryClassName= 'Zend_Registry'`
static

Class name of the singleton registry object.

Default value `Zend_Registry` Details

Type
  string

### Methods

`__construct( array $array = array, integer $flags = parent ) : void`

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

Parameters

Name | Type | Description
--- | --- | ---
$array | array | data array
$flags | integer | ArrayObject flags

`_unsetInstance( ) : void`
static

Unset the default registry instance.

Primarily used in tearDown() in unit tests.

Details

returns
  void

`append( ) : void`

Inherited from:
`asort( ) : void`

Inherited from:
`count( ) : void`

Inherited from:
`exchangeArray( ) : void`

Inherited from:
`get( string $index ) : mixed`
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

Name | Type | Description
--- | --- | ---
$index | string | get the value associated with $index

Returns

Type | Description
--- | ---
mixed |

Throws

Exception | Description
--- | ---
\Zend_Exception | if no entry is registerd for $index.

`getArrayCopy( ) : void`

Inherited from:
`getFlags( ) : void`

Inherited from:
`getInstance( ) : \Zend_Registry`
static

Retrieves the default registry instance.

Returns

Type | Description
--- | ---
\Zend_Registry |

`getIterator( ) : void`

Inherited from:
`getIteratorClass( ) : void`

Inherited from:
`init( ) : void`
static

Initialize the default registry instance.

`isRegistered( string $index ) : boolean`
static

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

Parameters

Name | Type | Description
--- | --- | ---
$index | string |

Returns

Type | Description
--- | ---
boolean |

`ksort( ) : void`

Inherited from:
`natcasesort( ) : void`

Inherited from:
`natsort( ) : void`

Inherited from:
`offsetExists( string $index ) : void`

Parameters

Name | Type | Description
--- | --- | ---
$index | string |

Details

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

`offsetGet( ) : void`

Inherited from:
`offsetSet( ) : void`

Inherited from:
`offsetUnset( ) : void`

Inherited from:
`serialize( ) : void`

Inherited from:
`set( string $index, mixed $value ) : void`
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

Name | Type | Description
--- | --- | ---
$index | string | The location in the ArrayObject in which to store the value.
$value | mixed | The object to store in the ArrayObject.

`setClassName( string $registryClassName = Zend_Registry ) : void`
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

Name | Type | Description
--- | --- | ---
$registryClassName | string |

Throws

Exception | Description
--- | ---
\Zend_Exception | if the registry is initialized or if the class name is not valid.

`setFlags( ) : void`

Inherited from:
`setInstance( \Zend_Registry $registry ) : void`
static

Set the default registry instance to a specified instance.

Parameters

Name | Type | Description
--- | --- | ---
$registry | \Zend_Registry | An object instance of type Zend_Registry, or a subclass.

Throws

Exception | Description
--- | ---
\Zend_Exception | if registry is already initialized.

`setIteratorClass( ) : void`

Inherited from:
`uasort( ) : void`

Inherited from:
`uksort( ) : void`

Inherited from:
`unserialize( ) : void`

Inherited from:
Documentation was generated by DocBlox 0.13.3.