]> git.mxchange.org Git - core.git/blobdiff - inc/classes/middleware/database/class_DatabaseConnection.php
Updated domain without a dash :(
[core.git] / inc / classes / middleware / database / class_DatabaseConnection.php
index c55c75159c8f1a665115efb27a522410b75f74ba..5f407db41abb9cf48f7ffae87cb6e89fee43e45e 100644 (file)
@@ -2,11 +2,11 @@
 /**
  * Database selector class
  *
- * @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 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 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
@@ -36,7 +36,7 @@ class DatabaseConnection extends BaseMiddleware implements DatabaseConnector, Re
        private $dbLayer = NULL;
 
        // An instance of this class
-       private static $thisInstance = NULL;
+       private static $selfInstance = NULL;
 
        /**
         * Protected constructor
@@ -49,26 +49,23 @@ class DatabaseConnection extends BaseMiddleware implements DatabaseConnector, Re
        }
 
        // Create new database connection layer
-       public static final function createDatabaseConnection (DebugMiddleware $debugInstance, DatabaseFrontendInterface $dbLayer) {
+       public static final function createDatabaseConnection (DebugMiddleware $debugInstance, DatabaseBackendInterface $dbLayer) {
                // Get instance
                $databaseInstance = new DatabaseConnection();
 
-               // Set debug output handler
-               $databaseInstance->setDebugInstance($debugInstance);
-
                // Set database layer
                $databaseInstance->setDatabaseLayer($dbLayer);
 
                // Set db instance
-               self::$thisInstance = $databaseInstance;
+               self::$selfInstance = $databaseInstance;
 
                // Return instance
                return $databaseInstance;
        }
 
        // Get an instance of this class
-       public static final function getInstance () {
-               return self::$thisInstance;
+       public static final function getSelfInstance () {
+               return self::$selfInstance;
        }
 
        // Public setter for database connection
@@ -94,7 +91,7 @@ class DatabaseConnection extends BaseMiddleware implements DatabaseConnector, Re
         * @param       $dbLayer        An instance of the real database layer
         * @return      void
         */
-       public final function setDatabaseLayer (DatabaseFrontendInterface $dbLayer) {
+       public final function setDatabaseLayer (DatabaseBackendInterface $dbLayer) {
                $this->dbLayer = $dbLayer;
        }
 
@@ -120,7 +117,7 @@ class DatabaseConnection extends BaseMiddleware implements DatabaseConnector, Re
                $this->dbLayer->connectToDatabase();
 
                // Get result from query
-               $result = $this->dbLayer->querySelect('array', $tableName, $criteriaInstance);
+               $result = $this->dbLayer->querySelect($tableName, $criteriaInstance);
 
                // Return the result
                return $result;