Registry.php

Show: PublicProtectedPrivateinherited
Table of Contents
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-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Registry  
Version
$Id: Registry.php 24593 2012-01-05 20:35:02Z matthew $  

\Zend_Registry

Package: Zend\Registry
Generic storage class helps to manage global data.
Parent(s)
\ArrayObject
Category
Zend  
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Properties

>VPropertyprivate\Zend_Registry $_registry = null
static
Registry object provides storage for shared objects.
Default valuenullDetails
Type
\Zend_Registry
>VPropertyprivatestring $_registryClassName = 'Zend_Registry'
static
Class name of the singleton registry object.
Default value'Zend_Registry'Details
Type
string

Methods

methodpublic__construct(array $array = array(), integer $flags = parent::ARRAY_AS_PROPS) : void

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

Parameters
NameTypeDescription
$arrayarray

data array

$flagsinteger

ArrayObject flags

methodpublic_unsetInstance() : void
static

Unset the default registry instance.

Primarily used in tearDown() in unit tests.

Details
Returns
void  
methodpublicget(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
NameTypeDescription
$indexstring
  • get the value associated with $index
Returns
TypeDescription
mixed
Throws
ExceptionDescription
\Zend_Exceptionif no entry is registerd for $index.
methodpublicgetInstance() : \Zend_Registry
static

Retrieves the default registry instance.

Returns
TypeDescription
\Zend_Registry
methodprotectedinit() : void
static

Initialize the default registry instance.

methodpublicisRegistered(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
NameTypeDescription
$indexstring
Returns
TypeDescription
boolean
methodpublicoffsetExists(string $index) : void

Parameters
NameTypeDescription
$indexstring
Details
Returns
mixed Workaround for http://bugs.php.net/bug.php?id=40442 (ZF-960).  
methodpublicset(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
NameTypeDescription
$indexstring

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

$valuemixed

The object to store in the ArrayObject.

methodpublicsetClassName(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
NameTypeDescription
$registryClassNamestring
Throws
ExceptionDescription
\Zend_Exceptionif the registry is initialized or if the class name is not valid.
methodpublicsetInstance(\Zend_Registry $registry) : void
static

Set the default registry instance to a specified instance.

Parameters
NameTypeDescription
$registry\Zend_Registry

An object instance of type Zend_Registry, or a subclass.

Throws
ExceptionDescription
\Zend_Exceptionif registry is already initialized.
Documentation was generated by phpDocumentor 2.0.0a12.