Added missing methods to interface and added newly one to class.
[core.git] / inc / classes / middleware / database / class_DatabaseConnection.php
index 853cb951864110a2148298b427bad07a4a8e2609..dd4ce3258c635e8e412c93354732b7c98c7a2a52 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 - 2013 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
@@ -49,13 +49,10 @@ 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, DatabaseBackend $dbLayer) {
                // Get instance
                $databaseInstance = new DatabaseConnection();
 
-               // Set debug output handler
-               $databaseInstance->setDebugInstance($debugInstance);
-
                // Set database layer
                $databaseInstance->setDatabaseLayer($dbLayer);
 
@@ -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 (DatabaseBackend $dbLayer) {
                $this->dbLayer = $dbLayer;
        }
 
@@ -180,6 +177,17 @@ class DatabaseConnection extends BaseMiddleware implements DatabaseConnector, Re
                // Return the value
                return $primaryKey;
        }
+
+       /**
+        * Removes non-public data from given array.
+        *
+        * @param       $data   An array with possible non-public data that needs to be removed.
+        * @return      $data   A cleaned up array with only public data.
+        */
+       public function removeNonPublicDataFromArray (array $data) {
+               // Call database backend
+               return $this->dbLayer->removeNonPublicDataFromArray($data);
+       }
 }
 
 // [EOF]