]> git.mxchange.org Git - core.git/blobdiff - framework/main/classes/registry/class_
Continued:
[core.git] / framework / main / classes / registry / class_
index 7aa0e9138884a11c0780aa7ab098c68f6823d867..a4ffbcbceda27072f255889a086b5e82b44e5f63 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 // Own namespace
-namespace CoreFramework\Registry\!!!;
+namespace Org\Mxchange\CoreFramework\Registry\!!!;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Registry\BaseRegistry;
@@ -11,7 +11,7 @@ use Org\Mxchange\CoreFramework\Registry\Register;
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2017 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -32,14 +32,14 @@ class ???Registry extends BaseRegistry implements Register {
        /**
         * Instance of this class
         */
-       private static $registryInstance = null;
+       private static $registryInstances = [];
 
        /**
         * Protected constructor
         *
         * @return      void
         */
-       protected function __construct () {
+       private function __construct () {
                // Call parent constructor
                parent::__construct(__CLASS__);
        }
@@ -50,15 +50,15 @@ class ???Registry extends BaseRegistry implements Register {
         *
         * @return      $registryInstance       Instance of this class
         */
-       public final static function getRegistry () {
+       public final static function getRegistry (string $key) {
                // Is an instance there?
-               if (is_null(self::$registryInstance)) {
+               if (is_null(self::$registryInstances[$key])) {
                        // Not yet, so create one
-                       self::$registryInstance = new ???Registry();
-               } // END - if
+                       self::$registryInstances[$key] = new ???Registry();
+               }
 
                // Return the instance
-               return self::$registryInstance;
+               return self::$registryInstances[$key];
        }
 
 }