Skip to content

Commit 348b157

Browse files
committed
Cast tenant
1 parent 3ec6684 commit 348b157

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/Database/Database.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3863,6 +3863,9 @@ public function updateDocument(string $collection, string $id, Document $documen
38633863

38643864
$document = $this->withTransaction(function () use ($collection, $id, $document) {
38653865
$time = DateTime::now();
3866+
/**
3867+
* @var $old Document
3868+
*/
38663869
$old = Authorization::skip(fn () => $this->silent(
38673870
fn () =>
38683871
$this->getDocument($collection->getId(), $id, forUpdate: true)
@@ -3873,7 +3876,7 @@ public function updateDocument(string $collection, string $id, Document $documen
38733876
$document['$createdAt'] = $old->getCreatedAt(); // Make sure user doesn't switch createdAt
38743877

38753878
if ($this->adapter->getSharedTables()) {
3876-
$document['$tenant'] = $old->getAttribute('$tenant'); // Make sure user doesn't switch tenant
3879+
$document['$tenant'] = $old->getTenant(); // Make sure user doesn't switch tenant
38773880
}
38783881

38793882
$document = new Document($document);

0 commit comments

Comments
 (0)