Skip to content

Commit 7e84398

Browse files
abnegateclaude
andcommitted
fix: remove int cast from getTenant to fix strict type comparison
Document::getTenant() was casting numeric tenant strings to int, but Adapter::getTenant() stored the raw string from setTenant(). The strict !== comparison in getCollection() then failed because (int)1 !== "1", causing "Collection not found" for shared table projects on SQL adapters. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent cd13c1d commit 7e84398

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/Database/Document.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -177,13 +177,7 @@ public function getUpdatedAt(): ?string
177177
*/
178178
public function getTenant(): int|string|null
179179
{
180-
$tenant = $this->getAttribute('$tenant');
181-
182-
if (\is_numeric($tenant)) {
183-
return (int) $tenant;
184-
}
185-
186-
return $tenant;
180+
return $this->getAttribute('$tenant');
187181
}
188182

189183
/**

0 commit comments

Comments
 (0)