1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-06 06:34:04 +00:00

Separate data & domains logic

This commit is contained in:
Samuel Štancl 2020-03-14 19:36:28 +01:00
parent a86412af09
commit 0deb1f1376
2 changed files with 10 additions and 6 deletions

View file

@ -91,9 +91,11 @@ class DatabaseStorageDriver implements StorageDriver, CanDeleteKeys, CanFindByAn
};
if ($this->usesCache()) {
return $this->cache->findById($id, $dataQuery, $domainsQuery);
$data = $this->cache->getDataById($id, $dataQuery);
$domains = $this->cache->getDomainsById($id, $domainsQuery);
} else {
$data = $dataQuery();
$domains = $domainsQuery();
}
if (! $data) {
@ -101,7 +103,7 @@ class DatabaseStorageDriver implements StorageDriver, CanDeleteKeys, CanFindByAn
}
return Tenant::fromStorage($data)
->withDomains($domainsQuery());
->withDomains($domains);
}
/**