]> git.mxchange.org Git - core.git/blobdiff - inc/classes/main/result/class_DatabaseResult.php
Some cleanups, more usage of ObjectFactory:
[core.git] / inc / classes / main / result / class_DatabaseResult.php
index e0d169a5caadaff51f00daff0306291be33d7ed1..e2505df0d50fd1000ccb5d1379fd5fd696c3ec02 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 - 2011 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -34,7 +34,7 @@ class DatabaseResult extends BaseFrameworkSystem implements SearchableResult, Up
        /**
         * Current row
         */
-       private $currentRow = null;
+       private $currentRow = NULL;
 
        /**
         * Result array
@@ -64,10 +64,6 @@ class DatabaseResult extends BaseFrameworkSystem implements SearchableResult, Up
        protected function __construct () {
                // Call parent constructor
                parent::__construct(__CLASS__);
-
-               // Clean up a little
-               $this->removeNumberFormaters();
-               $this->removeSystemArray();
        }
 
        /**
@@ -76,7 +72,7 @@ class DatabaseResult extends BaseFrameworkSystem implements SearchableResult, Up
         * @param       $resultArray            The array holding the result from query
         * @return      $resultInstance         An instance of this class
         */
-       public final static function createDatabaseResult (array $resultArray) {
+       public static final function createDatabaseResult (array $resultArray) {
                // Get a new instance
                $resultInstance = new DatabaseResult();
 
@@ -163,7 +159,7 @@ class DatabaseResult extends BaseFrameworkSystem implements SearchableResult, Up
         */
        public function current () {
                // Default is not found
-               $current = null;
+               $current = NULL;
 
                // Does the current enty exist?
                if (isset($this->resultArray['rows'][$this->currentPos])) {
@@ -195,12 +191,12 @@ class DatabaseResult extends BaseFrameworkSystem implements SearchableResult, Up
        }
 
        /**
-        * Determines wether the status of the query was fine ("ok")
+        * Determines wether the status of the query was fine (LocalfileDatabase::RESULT_OKAY)
         *
         * @return      $ifStatusOkay   Wether the status of the query was okay
         */
        public function ifStatusIsOkay () {
-               return ((isset($this->resultArray['status'])) && ($this->resultArray['status'] === "ok"));
+               return ((isset($this->resultArray['status'])) && ($this->resultArray['status'] === LocalfileDatabase::RESULT_OKAY));
        }
 
        /**