Hoa central
Public Member Functions | Static Public Member Functions | Static Protected Member Functions | Static Private Attributes | List of all members
Hoa\Registry\Registry Class Reference
Inheritance diagram for Hoa\Registry\Registry:

Public Member Functions

 __construct ()
 

Static Public Member Functions

static set ($index, $value)
 
static get ($index)
 
static isRegistered ($index)
 
static remove ($index)
 

Static Protected Member Functions

static getInstance ()
 

Static Private Attributes

static $_instance = null
 

Detailed Description

Class .

Hold a register of something.

Definition at line 49 of file Registry.php.

Constructor & Destructor Documentation

Hoa\Registry\Registry::__construct ( )

Private constructor.

Returns
void
Exceptions

Definition at line 66 of file Registry.php.

67  {
68  throw new Exception(
69  'Cannot instance the %s object. Use set, get, remove ' .
70  'and isRegistered static methods instead.',
71  0,
72  __CLASS__
73  );
74 
75  return;
76  }

Member Function Documentation

static Hoa\Registry\Registry::get (   $index)
static

Get a registry.

Parameters
mixed$indexIndex of registry.
Returns
mixed
Exceptions

Definition at line 113 of file Registry.php.

114  {
115  $registry = static::getInstance();
116 
117  if (false === $registry->offsetExists($index)) {
118  throw new Exception(
119  'Registry %s does not exist.',
120  1,
121  $index
122  );
123  }
124 
125  return $registry->offsetGet($index);
126  }
static getInstance()
Definition: Core.php:193

Here is the call graph for this function:

Here is the caller graph for this function:

static Hoa\Registry\Registry::getInstance ( )
staticprotected

Get instance of .

Returns
object

Definition at line 83 of file Registry.php.

84  {
85  if (null === static::$_instance) {
86  static::$_instance = new parent();
87  }
88 
89  return static::$_instance;
90  }
static Hoa\Registry\Registry::isRegistered (   $index)
static

Check if an index is registered.

Parameters
mixed$indexIndex of registry.
Returns
bool

Definition at line 134 of file Registry.php.

135  {
136  return static::getInstance()->offsetExists($index);
137  }
static getInstance()
Definition: Core.php:193

Here is the call graph for this function:

static Hoa\Registry\Registry::remove (   $index)
static

Unset an registry.

Parameters
mixed$indexIndex of registry.
Returns
void

Definition at line 145 of file Registry.php.

146  {
147  static::getInstance()->offsetUnset($index);
148 
149  return;
150  }
static getInstance()
Definition: Core.php:193

Here is the call graph for this function:

static Hoa\Registry\Registry::set (   $index,
  $value 
)
static

Set a new registry.

Parameters
mixed$indexIndex of registry.
mixed$valueValue of registry.
Returns
void

Definition at line 99 of file Registry.php.

100  {
101  static::getInstance()->offsetSet($index, $value);
102 
103  return;
104  }
static getInstance()
Definition: Core.php:193

Here is the call graph for this function:

Member Data Documentation

Hoa\Registry\Registry::$_instance = null
staticprivate

Definition at line 56 of file Registry.php.


The documentation for this class was generated from the following file: