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:
parent
a86412af09
commit
0deb1f1376
2 changed files with 10 additions and 6 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue