API Documentation

Registry.php

Classes 
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Registry
version
$Id: Registry.php 20096 2010-01-06 02:05:09Z bkarwin $
Classes
Zend_Registry

Description

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.

Zend_Registry

Extends from
ArrayObject
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Registry
Properties
$_registryClassName
$_registry
Methods
getInstance
setInstance
init
setClassName
_unsetInstance
get
set
isRegistered
__construct
offsetExists

Description

Generic storage class helps to manage global data.

Properties

$_registry

Zend_Registry $_registry = 'null'

Registry object provides storage for shared objects.

Details

$_registry
Zend_Registry
visibility
private
default
null
final
false
static
true

$_registryClassName

string $_registryClassName = 'Zend_Registry'

Class name of the singleton registry object.

Details

$_registryClassName
string
visibility
private
default
Zend_Registry
final
false
static
true

Methods

__construct

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

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

Arguments
$array
array
data array
$flags
integer
ArrayObject flags
Details
visibility
public
final
false
static
false

_unsetInstance

_unsetInstance( ) :

Unset the default registry instance.

Primarily used in tearDown() in unit tests.

Details
visibility
public
final
false
static
true
returns
void

get

get( string $index ) : mixed

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.

Arguments
$index
string
- get the value associated with $index
Output
mixed
Details
visibility
public
final
false
static
true
throws
if no entry is registerd for $index.

getInstance

getInstance( ) : Zend_Registry

Retrieves the default registry instance.

Output
Zend_Registry
Details
visibility
public
final
false
static
true

init

init( ) : void

Initialize the default registry instance.

Details
visibility
protected
final
false
static
true

isRegistered

isRegistered( string $index ) : boolean

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

Arguments
$index
string
Output
boolean
Details
visibility
public
final
false
static
true

offsetExists

offsetExists( string $index ) :

Arguments
$index
string
Details
visibility
public
final
false
static
false
returns
mixed Workaround for http://bugs.php.net/bug.php?id=40442 (ZF-960).

set

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

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.

Arguments
$index
string
The location in the ArrayObject in which to store the value.
$value
mixed
The object to store in the ArrayObject.
Details
visibility
public
final
false
static
true

setClassName

setClassName( string $registryClassName = Zend_Registry ) : void

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.

Arguments
$registryClassName
string
Details
visibility
public
final
false
static
true
throws
if the registry is initialized or if the class name is not valid.

setInstance

setInstance( Zend_Registry $registry ) : void

Set the default registry instance to a specified instance.

Arguments
$registry
Zend_Registry
An object instance of type Zend_Registry, or a subclass.
Details
visibility
public
final
false
static
true
throws
if registry is already initialized.
Documentation was generated by DocBlox.