@@ -442,6 +442,11 @@ class Database
442442 */
443443 protected array $ documentTypes = [];
444444
445+ /**
446+ * List of collections allowed to join
447+ * @var array<string>
448+ */
449+ protected array $ joinsCollectionsIds = [];
445450
446451 /**
447452 * @var Authorization
@@ -5794,7 +5799,7 @@ public function updateDocuments(
57945799 minAllowedDate: $ this ->adapter ->getMinDateTime (),
57955800 maxAllowedDate: $ this ->adapter ->getMaxDateTime (),
57965801 supportForAttributes: $ this ->adapter ->getSupportForAttributes (),
5797- maxUIDLength: $ this ->adapter ->getMaxUIDLength ()
5802+ maxUIDLength: $ this ->adapter ->getMaxUIDLength (),
57985803 );
57995804
58005805 if (!$ validator ->isValid ($ queries )) {
@@ -7513,7 +7518,7 @@ public function deleteDocuments(
75137518 minAllowedDate: $ this ->adapter ->getMinDateTime (),
75147519 maxAllowedDate: $ this ->adapter ->getMaxDateTime (),
75157520 supportForAttributes: $ this ->adapter ->getSupportForAttributes (),
7516- maxUIDLength: $ this ->adapter ->getMaxUIDLength ()
7521+ maxUIDLength: $ this ->adapter ->getMaxUIDLength (),
75177522 );
75187523
75197524 if (!$ validator ->isValid ($ queries )) {
@@ -7763,7 +7768,8 @@ public function find(string $collection, array $queries = [], string $forPermiss
77637768 minAllowedDate: $ this ->adapter ->getMinDateTime (),
77647769 maxAllowedDate: $ this ->adapter ->getMaxDateTime (),
77657770 supportForAttributes: $ this ->adapter ->getSupportForAttributes (),
7766- maxUIDLength: $ this ->adapter ->getMaxUIDLength ()
7771+ maxUIDLength: $ this ->adapter ->getMaxUIDLength (),
7772+ joinsCollectionsIds: $ this ->joinsCollectionsIds ,
77677773 );
77687774 if (!$ validator ->isValid ($ queries )) {
77697775 throw new QueryException ($ validator ->getDescription ());
@@ -8017,7 +8023,8 @@ public function count(string $collection, array $queries = [], ?int $max = null)
80178023 minAllowedDate: $ this ->adapter ->getMinDateTime (),
80188024 maxAllowedDate: $ this ->adapter ->getMaxDateTime (),
80198025 supportForAttributes: $ this ->adapter ->getSupportForAttributes (),
8020- maxUIDLength: $ this ->adapter ->getMaxUIDLength ()
8026+ maxUIDLength: $ this ->adapter ->getMaxUIDLength (),
8027+ joinsCollectionsIds: $ this ->joinsCollectionsIds ,
80218028 );
80228029 if (!$ validator ->isValid ($ queries )) {
80238030 throw new QueryException ($ validator ->getDescription ());
@@ -8082,7 +8089,8 @@ public function sum(string $collection, string $attribute, array $queries = [],
80828089 minAllowedDate: $ this ->adapter ->getMinDateTime (),
80838090 maxAllowedDate: $ this ->adapter ->getMaxDateTime (),
80848091 supportForAttributes: $ this ->adapter ->getSupportForAttributes (),
8085- maxUIDLength: $ this ->adapter ->getMaxUIDLength ()
8092+ maxUIDLength: $ this ->adapter ->getMaxUIDLength (),
8093+ joinsCollectionsIds: $ this ->joinsCollectionsIds ,
80868094 );
80878095 if (!$ validator ->isValid ($ queries )) {
80888096 throw new QueryException ($ validator ->getDescription ());
@@ -9428,4 +9436,15 @@ private function rollbackAttributeMetadata(Document $collection, array $attribut
94289436 );
94299437 $ collection ->setAttribute ('attributes ' , \array_values ($ filteredAttributes ));
94309438 }
9439+
9440+ /**
9441+ * Add Join Collection
9442+ *
9443+ * @param string $collectionId
9444+ * @return void
9445+ */
9446+ public function addJoinCollection (string $ collectionId ): void
9447+ {
9448+ $ this ->joinsCollectionsIds [$ collectionId ] = true ;
9449+ }
94319450}
0 commit comments