Skip to content

Commit 4b5ee40

Browse files
committed
Rename function
1 parent 0de825d commit 4b5ee40

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

api.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -806,21 +806,21 @@ public function __construct(GenericDB $db, Cache $cache, int $ttl)
806806
$this->db = $db;
807807
$this->cache = $cache;
808808
$this->ttl = $ttl;
809-
$this->database = $this->loadTables(true);
809+
$this->database = $this->loadDatabase(true);
810810
$this->tables = [];
811811
}
812812

813-
private function loadTables(bool $useCache): ReflectedDatabase
813+
private function loadDatabase(bool $useCache): ReflectedDatabase
814814
{
815815
$data = $useCache ? $this->cache->get('ReflectedDatabase') : '';
816816
if ($data != '') {
817-
$tables = ReflectedDatabase::fromJson(json_decode(gzuncompress($data)));
817+
$database = ReflectedDatabase::fromJson(json_decode(gzuncompress($data)));
818818
} 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));
821821
$this->cache->set('ReflectedDatabase', $data, $this->ttl);
822822
}
823-
return $tables;
823+
return $database;
824824
}
825825

826826
private function loadTable(String $tableName, bool $useCache): ReflectedTable
@@ -838,7 +838,7 @@ private function loadTable(String $tableName, bool $useCache): ReflectedTable
838838

839839
public function refreshTables()
840840
{
841-
$this->database = $this->loadTables(false);
841+
$this->database = $this->loadDatabase(false);
842842
}
843843

844844
public function refreshTable(String $tableName)

src/Tqdev/PhpCrudApi/Column/ReflectionService.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,21 @@ public function __construct(GenericDB $db, Cache $cache, int $ttl)
1919
$this->db = $db;
2020
$this->cache = $cache;
2121
$this->ttl = $ttl;
22-
$this->database = $this->loadTables(true);
22+
$this->database = $this->loadDatabase(true);
2323
$this->tables = [];
2424
}
2525

26-
private function loadTables(bool $useCache): ReflectedDatabase
26+
private function loadDatabase(bool $useCache): ReflectedDatabase
2727
{
2828
$data = $useCache ? $this->cache->get('ReflectedDatabase') : '';
2929
if ($data != '') {
30-
$tables = ReflectedDatabase::fromJson(json_decode(gzuncompress($data)));
30+
$database = ReflectedDatabase::fromJson(json_decode(gzuncompress($data)));
3131
} 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));
3434
$this->cache->set('ReflectedDatabase', $data, $this->ttl);
3535
}
36-
return $tables;
36+
return $database;
3737
}
3838

3939
private function loadTable(String $tableName, bool $useCache): ReflectedTable
@@ -51,7 +51,7 @@ private function loadTable(String $tableName, bool $useCache): ReflectedTable
5151

5252
public function refreshTables()
5353
{
54-
$this->database = $this->loadTables(false);
54+
$this->database = $this->loadDatabase(false);
5555
}
5656

5757
public function refreshTable(String $tableName)

0 commit comments

Comments
 (0)