cs Iterator and Registry

This commit is contained in:
Dominik Liebler
2013-09-21 22:17:54 +02:00
parent 4b66417509
commit 9484868299
7 changed files with 118 additions and 160 deletions

View File

@@ -37,7 +37,7 @@ class Multiton
*
* @var array
*/
private static $_instances = array();
private static $instances = array();
/**
* should not be called from outside: private!
@@ -53,15 +53,16 @@ class Multiton
* uses lazy initialization
*
* @param string $instanceName
*
* @return Multiton
*/
public static function getInstance($instanceName)
{
if ( ! array_key_exists($instanceName, self::$_instances)) {
self::$_instances[$instanceName] = new self();
if (!array_key_exists($instanceName, self::$instances)) {
self::$instances[$instanceName] = new self();
}
return self::$_instances[$instanceName];
return self::$instances[$instanceName];
}
/**