@@ -18,6 +18,8 @@ abstract class Adapter
1818
1919 protected ?int $ tenant = null ;
2020
21+ protected bool $ tenantPerDocument = false ;
22+
2123 protected int $ inTransaction = 0 ;
2224
2325 /**
@@ -190,6 +192,34 @@ public function getTenant(): ?int
190192 return $ this ->tenant ;
191193 }
192194
195+ /**
196+ * Set Tenant Per Document.
197+ *
198+ * Set whether to use a different tenant for each document
199+ *
200+ * @param bool $tenantPerDocument
201+ *
202+ * @return bool
203+ */
204+ public function setTenantPerDocument (bool $ tenantPerDocument ): bool
205+ {
206+ $ this ->tenantPerDocument = $ tenantPerDocument ;
207+
208+ return true ;
209+ }
210+
211+ /**
212+ * Get Tenant Per Document.
213+ *
214+ * Get whether to use a different tenant for each document
215+ *
216+ * @return bool
217+ */
218+ public function getTenantPerDocument (): bool
219+ {
220+ return $ this ->tenantPerDocument ;
221+ }
222+
193223 /**
194224 * Set metadata for query comments
195225 *
@@ -261,7 +291,7 @@ abstract public function setTimeout(int $milliseconds, string $event = Database:
261291 public function clearTimeout (string $ event ): void
262292 {
263293 // Clear existing callback
264- $ this ->before ($ event , 'timeout ' , null );
294+ $ this ->before ($ event , 'timeout ' );
265295 }
266296
267297 /**
@@ -301,7 +331,6 @@ abstract public function rollbackTransaction(): bool;
301331 * Check if a transaction is active.
302332 *
303333 * @return bool
304- * @throws DatabaseException
305334 */
306335 public function inTransaction (): bool
307336 {
@@ -482,7 +511,7 @@ abstract public function createAttribute(string $collection, string $id, string
482511 * @param int $size
483512 * @param bool $signed
484513 * @param bool $array
485- * @param string $newKey
514+ * @param string|null $newKey
486515 *
487516 * @return bool
488517 */
@@ -620,6 +649,7 @@ abstract public function createDocuments(string $collection, array $documents):
620649 * Update Document
621650 *
622651 * @param string $collection
652+ * @param string $id
623653 * @param Document $document
624654 *
625655 * @return Document
0 commit comments