@@ -1260,7 +1260,7 @@ public function updateCollection(string $id, array $permissions, bool $documentS
1260
1260
1261
1261
if (
1262
1262
$ this ->adapter ->getSharedTables ()
1263
- && $ collection ->getAttribute ( ' $tenant ' ) != $ this ->adapter ->getTenant ()
1263
+ && $ collection ->getTenant ( ) != = $ this ->adapter ->getTenant ()
1264
1264
) {
1265
1265
throw new NotFoundException ('Collection not found ' );
1266
1266
}
@@ -1288,13 +1288,11 @@ public function getCollection(string $id): Document
1288
1288
{
1289
1289
$ collection = $ this ->silent (fn () => $ this ->getDocument (self ::METADATA , $ id ));
1290
1290
1291
- $ tenant = $ collection ->getAttribute ('$tenant ' );
1292
-
1293
1291
if (
1294
1292
$ id !== self ::METADATA
1295
1293
&& $ this ->adapter ->getSharedTables ()
1296
- && $ tenant !== null
1297
- && $ tenant ! = $ this ->adapter ->getTenant ()
1294
+ && $ collection -> getTenant () !== null
1295
+ && $ collection -> getTenant () != = $ this ->adapter ->getTenant ()
1298
1296
) {
1299
1297
return new Document ();
1300
1298
}
@@ -1341,7 +1339,7 @@ public function getSizeOfCollection(string $collection): int
1341
1339
throw new NotFoundException ('Collection not found ' );
1342
1340
}
1343
1341
1344
- if ($ this ->adapter ->getSharedTables () && $ collection ->getAttribute ( ' $tenant ' ) != $ this ->adapter ->getTenant ()) {
1342
+ if ($ this ->adapter ->getSharedTables () && $ collection ->getTenant ( ) != = $ this ->adapter ->getTenant ()) {
1345
1343
throw new NotFoundException ('Collection not found ' );
1346
1344
}
1347
1345
@@ -1367,7 +1365,7 @@ public function getSizeOfCollectionOnDisk(string $collection): int
1367
1365
throw new NotFoundException ('Collection not found ' );
1368
1366
}
1369
1367
1370
- if ($ this ->adapter ->getSharedTables () && $ collection ->getAttribute ( ' $tenant ' ) != $ this ->adapter ->getTenant ()) {
1368
+ if ($ this ->adapter ->getSharedTables () && $ collection ->getTenant ( ) != = $ this ->adapter ->getTenant ()) {
1371
1369
throw new NotFoundException ('Collection not found ' );
1372
1370
}
1373
1371
@@ -1390,7 +1388,7 @@ public function deleteCollection(string $id): bool
1390
1388
throw new NotFoundException ('Collection not found ' );
1391
1389
}
1392
1390
1393
- if ($ this ->adapter ->getSharedTables () && $ collection ->getAttribute ( ' $tenant ' ) != $ this ->adapter ->getTenant ()) {
1391
+ if ($ this ->adapter ->getSharedTables () && $ collection ->getTenant ( ) != = $ this ->adapter ->getTenant ()) {
1394
1392
throw new NotFoundException ('Collection not found ' );
1395
1393
}
1396
1394
@@ -3873,7 +3871,7 @@ public function updateDocument(string $collection, string $id, Document $documen
3873
3871
$ document ['$createdAt ' ] = $ old ->getCreatedAt (); // Make sure user doesn't switch createdAt
3874
3872
3875
3873
if ($ this ->adapter ->getSharedTables ()) {
3876
- $ document ['$tenant ' ] = $ old ->getAttribute ( ' $tenant ' ); // Make sure user doesn't switch tenant
3874
+ $ document ['$tenant ' ] = $ old ->getTenant ( ); // Make sure user doesn't switch tenant
3877
3875
}
3878
3876
3879
3877
$ document = new Document ($ document );
0 commit comments