|
@@ -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)
|