If no valid entry (e.g. failed query) is counted, this does now return -1
[core.git] / inc / classes / main / database / class_BaseDatabaseWrapper.php
index 9ff850b1e2a34f83965d0576c0070442bfadaba0..494d994b43f685df2fb3514a61b5ab9ad3a2e2ed 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007 - 2009 Roland Haeder, this is free software
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -30,23 +30,19 @@ class BaseDatabaseWrapper extends BaseFrameworkSystem {
        /**
         * Current table name to use
         */
-       private $tableName = "unknown";
+       private $tableName = 'unknown';
 
        /**
         * Protected constructor
         *
         * @return      void
         */
-       protected function __construct($class) {
+       protected function __construct ($class) {
                // Call parent constructor
                parent::__construct($class);
 
                // Initialize the cache instance
                $this->initCacheInstance();
-
-               // Clean up a little
-               $this->removeNumberFormaters();
-               $this->removeSystemArray();
        }
 
        /**
@@ -88,7 +84,7 @@ class BaseDatabaseWrapper extends BaseFrameworkSystem {
                        } else {
                                // This invalid result must be wrapped
                                $result = array(
-                                       'status'                => "invalid",
+                                       'status'                => 'invalid',
                                        'exception'             => $this->getDatabaseInstance()->getLastException()
                                );
                        }
@@ -108,7 +104,7 @@ class BaseDatabaseWrapper extends BaseFrameworkSystem {
         * @return      $numRows                        Numbers of rows of database entries
         */
        public function doSelectCountByCriteria (Criteria $criteriaInstance) {
-               // Total numbers is zero by default
+               // Total numbers is -1 so we can distinglish between failed and valid queries
                $numRows = 0;
 
                // Get the result from above method