X-Git-Url: https://git.mxchange.org/?p=core.git;a=blobdiff_plain;f=inc%2Fclasses%2Fmiddleware%2Fdatabase%2Fclass_DatabaseConnection.php;h=853cb951864110a2148298b427bad07a4a8e2609;hp=2f61bfa571934b7545651b11a43bc3e24f60d462;hb=9114236c06107fd4d9c20f7e8ebabf16e7383d45;hpb=84e2207412d3c6ea9f940a83b2cdd4503509808a diff --git a/inc/classes/middleware/database/class_DatabaseConnection.php b/inc/classes/middleware/database/class_DatabaseConnection.php index 2f61bfa5..853cb951 100644 --- a/inc/classes/middleware/database/class_DatabaseConnection.php +++ b/inc/classes/middleware/database/class_DatabaseConnection.php @@ -4,7 +4,7 @@ * * @author Roland Haeder * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Core Developer Team + * @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 * @@ -33,42 +33,42 @@ class DatabaseConnection extends BaseMiddleware implements DatabaseConnector, Re ); // The real database layer - private $dbLayer = null; + private $dbLayer = NULL; // An instance of this class - private static $thisInstance = null; + private static $selfInstance = 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::$selfInstance = $databaseInstance; // Return instance - return $dbInstance; + return $databaseInstance; } // Get an instance of this class - public final static function getInstance () { - return self::$thisInstance; + public static final function getSelfInstance () { + return self::$selfInstance; } // Public setter for database connection @@ -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;