]> git.mxchange.org Git - shipsimu.git/blobdiff - inc/classes/main/database/databases/class_LocalFileDatabase.php
Typos fixed and special command resolver are now possible
[shipsimu.git] / inc / classes / main / database / databases / class_LocalFileDatabase.php
index 96b5c2291eab729c88552c13a6db66c0ce6af999..dc4371efd13fcb5a08bbb64a1bb185ddcd5726fd 100644 (file)
@@ -70,6 +70,11 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend
         */
        private $tableInfo = array();
 
+       /**
+        * Element for index
+        */
+       private $indexKey = "__idx";
+
        /**
         * The protected constructor. Do never instance from outside! You need to
         * set a local file path. The class will then validate it.
@@ -210,6 +215,15 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend
                return $this->fileExtension;
        }
 
+       /**
+        * Getter for index key
+        *
+        * @return      $indexKey       Index key
+        */
+       public final function getIndexKey () {
+               return $this->indexKey;
+       }
+
        /**
         * Reads a local data file  and returns it's contents in an array
         *
@@ -259,7 +273,7 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend
        }
 
        /**
-        * Getter for table information file contents or an empty if the info file was not created
+        * Getter for table information file contents or an empty if info file was not created
         *
         * @param       $dataSetInstance        An instance of a database set class
         * @return      $infoArray                      An array with all table informations
@@ -402,7 +416,7 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend
                                                        } // END - if
 
                                                        // Set id number
-                                                       $dataArray['__idx'] = $idx;
+                                                       $dataArray[$this->getIndexKey()] = $idx;
 
                                                        // Entry found!
                                                        $resultData['rows'][] = $dataArray;