Static method getInstance() conflicts with getInstance() in class BaseRegistry,
[core.git] / inc / classes / middleware / database / class_DatabaseConnection.php
index 6f0a4e1ef2660a5b0664689a5aaf11feb749b591..0a688c39638799f2a2d0cf01628ac2d21d350abf 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -26,53 +26,53 @@ class DatabaseConnection extends BaseMiddleware implements DatabaseConnector, Re
         * Array for connection data
         */
        private $connectData = array(
-               'login' => "",
-               'pass'  => "",
-               'dbase' => "",
-               'host'  => ""
+               'login' => '',
+               'pass'  => '',
+               'dbase' => '',
+               'host'  => ''
        );
 
        // The real database layer
-       private $dbLayer = null;
+       private $dbLayer = NULL;
 
        // An instance of this class
-       private static $thisInstance = null;
+       private static $thisInstance = NULL;
 
        /**
         * Protected constructor
         *
         * @return      void
         */
-       protected function __construct() {
+       protected function __construct () {
                // Call parent constructor
                parent::__construct(__CLASS__);
        }
 
        // Create new database connection layer
-       public final static function createDatabaseConnection (DebugMiddleware $debugInstance, DatabaseFrontendInterface $dbLayer) {
+       public static final function createDatabaseConnection (DebugMiddleware $debugInstance, DatabaseFrontendInterface $dbLayer) {
                // Get instance
-               $dbInstance = new DatabaseConnection();
+               $databaseInstance = new DatabaseConnection();
 
                // Set debug output handler
-               $dbInstance->setDebugInstance($debugInstance);
+               $databaseInstance->setDebugInstance($debugInstance);
 
                // Set database layer
-               $dbInstance->setDatabaseLayer($dbLayer);
+               $databaseInstance->setDatabaseLayer($dbLayer);
 
                // Set db instance
-               self::$thisInstance = $dbInstance;
+               self::$thisInstance = $databaseInstance;
 
                // Return instance
-               return $dbInstance;
+               return $databaseInstance;
        }
 
        // Get an instance of this class
-       public final static function getInstance () {
+       public static final function getSelfInstance () {
                return self::$thisInstance;
        }
 
        // Public setter for database connection
-       public final function setConnectionData ($login, $pass, $dbase, $host="localhost") {
+       public final function setConnectionData ($login, $pass, $dbase, $host='localhost') {
                // Transfer connection data
                $this->connectData['login'] = (string) $login;
                $this->connectData['pass']  = (string) $pass;
@@ -108,10 +108,10 @@ class DatabaseConnection extends BaseMiddleware implements DatabaseConnector, Re
        }
 
        /**
-        * Runs a "select" statement on the database layer with given table name
+        * Runs a 'select' statement on the database layer with given table name
         * and criteria. If this doesn't fail the result will be returned
         *
-        * @param       $tableName                      Name of the "table" we shall query
+        * @param       $tableName                      Name of the 'table' we shall query
         * @param       $criteriaInstance       An instance of a Criteria class
         * @return      $result                         The result as an array
         */
@@ -120,7 +120,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;
@@ -137,7 +137,7 @@ class DatabaseConnection extends BaseMiddleware implements DatabaseConnector, Re
        }
 
        /**
-        * "Inserts" a data set instance into a local file database folder
+        * 'Inserts' a data set instance into a local file database folder
         *
         * @param       $dataSetInstance        A storeable data set
         * @return      void
@@ -151,7 +151,7 @@ class DatabaseConnection extends BaseMiddleware implements DatabaseConnector, Re
        }
 
        /**
-        * "Updates" a data set instance with a database layer
+        * 'Updates' a data set instance with a database layer
         *
         * @param       $dataSetInstance        A storeable data set
         * @return      void