]> git.mxchange.org Git - core.git/blobdiff - inc/main/classes/database/backend/class_CachedLocalFileDatabase.php
Continued:
[core.git] / inc / main / classes / database / backend / class_CachedLocalFileDatabase.php
index 825a70e416eeab30e01c38ec50b4a417ba6b83e1..f39a866a8261998b0ce5a0429a29f9a11cab9130 100644 (file)
@@ -1,4 +1,7 @@
 <?php
+// Own namespace
+namespace CoreFramework\Database\Backend\Lfdb;
+
 /**
  * Database backend class for storing objects in locally created files.
  *
@@ -10,7 +13,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2015 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2017 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -279,6 +282,9 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac
         * @return      void
         */
        private function updateTableInfoFile (StoreableCriteria $dataSetInstance) {
+               // Get table name from criteria
+               $tableName = $dataSetInstance->getTableName();
+
                // Create FQFN for creating the table information file
                $fqfn = $this->generateFqfnFromDataSet($dataSetInstance, 'info');
 
@@ -287,7 +293,7 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac
                $this->tableInfo[$tableName]['last_updated'] = time();
 
                // Write the data to the file
-               $this->writeDataArrayToFqfn($fqfn, $this->tableInfo[$dataSetInstance->getTableName()]);
+               $this->writeDataArrayToFqfn($fqfn, $this->tableInfo[$tableName]);
        }
 
        /**
@@ -297,7 +303,7 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac
         * @return      void
         */
        private function updatePrimaryKey (StoreableCriteria $dataSetInstance) {
-               // "Cache" table name
+               // Get table name from criteria
                $tableName = $dataSetInstance->getTableName();
 
                // Get the information array from lower method
@@ -667,7 +673,5 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE: tableName=' . $tableName . ',count=' . $count . ' - EXIT!');
                return $count;
        }
-}
 
-// [EOF]
-?>
+}