This is more flexible so better take it.
[core.git] / inc / classes / main / factories / database / class_DatabaseWrapperFactory.php
index f2e8ab1925370869fb73897d401db9adbdced038..5ecdea49a702be2cc9816e07a86261906f8039e2 100644 (file)
@@ -2,11 +2,11 @@
 /**
  * A factory class for socket registries
  *
- * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2015 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.ship-simu.org
+ * @link               http://www.shipsimu.org
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 class DatabaseWrapperFactory extends ObjectFactory {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
        /**
         * Returns a singleton socket registry instance. If an instance is found in
         * the registry it will be returned, else a new instance is created and
@@ -39,7 +49,7 @@ class DatabaseWrapperFactory extends ObjectFactory {
                        $wrapperInstance = $registryInstance->getInstance($wrapperName);
                } else {
                        // Get the registry instance
-                       $wrapperInstance = ObjectFactory::createObjectByConfiguredName($wrapperName);
+                       $wrapperInstance = self::createObjectByConfiguredName($wrapperName);
 
                        // Set the instance in registry for further use
                        $registryInstance->addInstance($wrapperName, $wrapperInstance);
@@ -48,16 +58,6 @@ class DatabaseWrapperFactory extends ObjectFactory {
                // Return the instance
                return $wrapperInstance;
        }
-
-       /**
-        * Protected constructor
-        *
-        * @return      void
-        */
-       protected function __construct () {
-               // Call parent constructor
-               parent::__construct(__CLASS__);
-       }
 }
 
 // [EOF]