Browse Source

Rename function

Maurits van der Schee 6 years ago
parent
commit
4b5ee40ec0
2 changed files with 14 additions and 14 deletions
  1. 7
    7
      api.php
  2. 7
    7
      src/Tqdev/PhpCrudApi/Column/ReflectionService.php

+ 7
- 7
api.php View File

@@ -806,21 +806,21 @@ class ReflectionService
806 806
         $this->db = $db;
807 807
         $this->cache = $cache;
808 808
         $this->ttl = $ttl;
809
-        $this->database = $this->loadTables(true);
809
+        $this->database = $this->loadDatabase(true);
810 810
         $this->tables = [];
811 811
     }
812 812
 
813
-    private function loadTables(bool $useCache): ReflectedDatabase
813
+    private function loadDatabase(bool $useCache): ReflectedDatabase
814 814
     {
815 815
         $data = $useCache ? $this->cache->get('ReflectedDatabase') : '';
816 816
         if ($data != '') {
817
-            $tables = ReflectedDatabase::fromJson(json_decode(gzuncompress($data)));
817
+            $database = ReflectedDatabase::fromJson(json_decode(gzuncompress($data)));
818 818
         } else {
819
-            $tables = ReflectedDatabase::fromReflection($this->db->reflection());
820
-            $data = gzcompress(json_encode($tables, JSON_UNESCAPED_UNICODE));
819
+            $database = ReflectedDatabase::fromReflection($this->db->reflection());
820
+            $data = gzcompress(json_encode($database, JSON_UNESCAPED_UNICODE));
821 821
             $this->cache->set('ReflectedDatabase', $data, $this->ttl);
822 822
         }
823
-        return $tables;
823
+        return $database;
824 824
     }
825 825
 
826 826
     private function loadTable(String $tableName, bool $useCache): ReflectedTable
@@ -838,7 +838,7 @@ class ReflectionService
838 838
 
839 839
     public function refreshTables()
840 840
     {
841
-        $this->database = $this->loadTables(false);
841
+        $this->database = $this->loadDatabase(false);
842 842
     }
843 843
 
844 844
     public function refreshTable(String $tableName)

+ 7
- 7
src/Tqdev/PhpCrudApi/Column/ReflectionService.php View File

@@ -19,21 +19,21 @@ class ReflectionService
19 19
         $this->db = $db;
20 20
         $this->cache = $cache;
21 21
         $this->ttl = $ttl;
22
-        $this->database = $this->loadTables(true);
22
+        $this->database = $this->loadDatabase(true);
23 23
         $this->tables = [];
24 24
     }
25 25
 
26
-    private function loadTables(bool $useCache): ReflectedDatabase
26
+    private function loadDatabase(bool $useCache): ReflectedDatabase
27 27
     {
28 28
         $data = $useCache ? $this->cache->get('ReflectedDatabase') : '';
29 29
         if ($data != '') {
30
-            $tables = ReflectedDatabase::fromJson(json_decode(gzuncompress($data)));
30
+            $database = ReflectedDatabase::fromJson(json_decode(gzuncompress($data)));
31 31
         } else {
32
-            $tables = ReflectedDatabase::fromReflection($this->db->reflection());
33
-            $data = gzcompress(json_encode($tables, JSON_UNESCAPED_UNICODE));
32
+            $database = ReflectedDatabase::fromReflection($this->db->reflection());
33
+            $data = gzcompress(json_encode($database, JSON_UNESCAPED_UNICODE));
34 34
             $this->cache->set('ReflectedDatabase', $data, $this->ttl);
35 35
         }
36
-        return $tables;
36
+        return $database;
37 37
     }
38 38
 
39 39
     private function loadTable(String $tableName, bool $useCache): ReflectedTable
@@ -51,7 +51,7 @@ class ReflectionService
51 51
 
52 52
     public function refreshTables()
53 53
     {
54
-        $this->database = $this->loadTables(false);
54
+        $this->database = $this->loadDatabase(false);
55 55
     }
56 56
 
57 57
     public function refreshTable(String $tableName)

Loading…
Cancel
Save