diff --git a/src/Database/Database.php b/src/Database/Database.php index 32682716a..cf91fd310 100644 --- a/src/Database/Database.php +++ b/src/Database/Database.php @@ -1856,7 +1856,7 @@ public function updateCollection(string $id, array $permissions, bool $documentS if ( $this->adapter->getSharedTables() - && $collection->getTenant() !== $this->adapter->getTenant() + && $collection->getTenant() != $this->adapter->getTenant() ) { throw new NotFoundException('Collection not found'); } @@ -1892,7 +1892,7 @@ public function getCollection(string $id): Document $id !== self::METADATA && $this->adapter->getSharedTables() && $collection->getTenant() !== null - && $collection->getTenant() !== $this->adapter->getTenant() + && $collection->getTenant() != $this->adapter->getTenant() ) { return new Document(); } @@ -1947,7 +1947,7 @@ public function getSizeOfCollection(string $collection): int throw new NotFoundException('Collection not found'); } - if ($this->adapter->getSharedTables() && $collection->getTenant() !== $this->adapter->getTenant()) { + if ($this->adapter->getSharedTables() && $collection->getTenant() != $this->adapter->getTenant()) { throw new NotFoundException('Collection not found'); } @@ -1973,7 +1973,7 @@ public function getSizeOfCollectionOnDisk(string $collection): int throw new NotFoundException('Collection not found'); } - if ($this->adapter->getSharedTables() && $collection->getTenant() !== $this->adapter->getTenant()) { + if ($this->adapter->getSharedTables() && $collection->getTenant() != $this->adapter->getTenant()) { throw new NotFoundException('Collection not found'); } @@ -2007,7 +2007,7 @@ public function deleteCollection(string $id): bool throw new NotFoundException('Collection not found'); } - if ($this->adapter->getSharedTables() && $collection->getTenant() !== $this->adapter->getTenant()) { + if ($this->adapter->getSharedTables() && $collection->getTenant() != $this->adapter->getTenant()) { throw new NotFoundException('Collection not found'); } @@ -7201,7 +7201,7 @@ public function upsertDocumentsWithIncrease( if ($document->getTenant() === null) { throw new DatabaseException('Missing tenant. Tenant must be set when tenant per document is enabled.'); } - if (!$old->isEmpty() && $old->getTenant() !== $document->getTenant()) { + if (!$old->isEmpty() && $old->getTenant() != $document->getTenant()) { throw new DatabaseException('Tenant cannot be changed.'); } } else { diff --git a/src/Database/Validator/Structure.php b/src/Database/Validator/Structure.php index a65734dbd..9644ac1d5 100644 --- a/src/Database/Validator/Structure.php +++ b/src/Database/Validator/Structure.php @@ -340,6 +340,9 @@ protected function checkForInvalidAttributeValues(array $structure, array $keys) switch ($type) { case Database::VAR_ID: + if ($attribute['$id'] === '$tenant') { + break; + } $validators[] = new Sequence($this->idAttributeType, $attribute['$id'] === '$sequence'); break;