1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-12 12:44:02 +00:00

Only put to storage when persisted

This commit is contained in:
Samuel Štancl 2019-10-28 15:01:14 +01:00
parent 464832be29
commit 853fdb19fa

View file

@ -333,12 +333,18 @@ class Tenant implements ArrayAccess
}
if (is_array($key)) {
$this->storage->putMany($key);
if ($this->persisted) {
$this->storage->putMany($key);
}
foreach ($key as $k => $v) { // Add to cache
$this->data[$k] = $v;
}
} else {
$this->storage->put($key, $value);
if ($this->persisted) {
$this->storage->put($key, $value);
}
$this->data[$key] = $value;
}