mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 13:54:03 +00:00
Only put to storage when persisted
This commit is contained in:
parent
464832be29
commit
853fdb19fa
1 changed files with 8 additions and 2 deletions
|
|
@ -333,12 +333,18 @@ class Tenant implements ArrayAccess
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_array($key)) {
|
if (is_array($key)) {
|
||||||
$this->storage->putMany($key);
|
if ($this->persisted) {
|
||||||
|
$this->storage->putMany($key);
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($key as $k => $v) { // Add to cache
|
foreach ($key as $k => $v) { // Add to cache
|
||||||
$this->data[$k] = $v;
|
$this->data[$k] = $v;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$this->storage->put($key, $value);
|
if ($this->persisted) {
|
||||||
|
$this->storage->put($key, $value);
|
||||||
|
}
|
||||||
|
|
||||||
$this->data[$key] = $value;
|
$this->data[$key] = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue