]> git.mxchange.org Git - shipsimu.git/blobdiff - inc/classes/main/database/databases/class_LocalFileDatabase.php
Setting index is now much nicer (more abstract!)
[shipsimu.git] / inc / classes / main / database / databases / class_LocalFileDatabase.php
index 96b5c2291eab729c88552c13a6db66c0ce6af999..29e2e5e0f397f3dab498d8dc80ce70565a1598ce 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
         *
@@ -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;