@@ -367,7 +367,7 @@ public function getDocument(string $collection, string $id, array $queries = [],
367367 $ document = $ document [0 ];
368368
369369 if (\array_key_exists ('_id ' , $ document )) {
370- $ document ['$internalId ' ] = $ document ['_id ' ];
370+ $ document ['$sequence ' ] = $ document ['_id ' ];
371371 unset($ document ['_id ' ]);
372372 }
373373 if (\array_key_exists ('_uid ' , $ document )) {
@@ -441,12 +441,12 @@ public function updateDocuments(string $collection, Document $updates, array $do
441441 }
442442
443443 $ name = $ this ->filter ($ collection );
444- $ internalIds = \array_map (fn ($ document ) => $ document ->getInternalId (), $ documents );
444+ $ sequences = \array_map (fn ($ document ) => $ document ->getInternalId (), $ documents );
445445
446446 $ sql = "
447447 UPDATE {$ this ->getSQLTable ($ name )}
448448 SET {$ columns }
449- WHERE _id IN ( " . \implode (', ' , \array_map (fn ($ index ) => ":_id_ {$ index }" , \array_keys ($ internalIds ))) . ")
449+ WHERE _id IN ( " . \implode (', ' , \array_map (fn ($ index ) => ":_id_ {$ index }" , \array_keys ($ sequences ))) . ")
450450 {$ this ->getTenantQuery ($ collection )}
451451 " ;
452452
@@ -457,7 +457,7 @@ public function updateDocuments(string $collection, Document $updates, array $do
457457 $ stmt ->bindValue (':_tenant ' , $ this ->tenant );
458458 }
459459
460- foreach ($ internalIds as $ id => $ value ) {
460+ foreach ($ sequences as $ id => $ value ) {
461461 $ stmt ->bindValue (":_id_ {$ id }" , $ value );
462462 }
463463
@@ -640,15 +640,15 @@ public function updateDocuments(string $collection, Document $updates, array $do
640640 * Delete Documents
641641 *
642642 * @param string $collection
643- * @param array<string> $internalIds
643+ * @param array<string> $sequences
644644 * @param array<string> $permissionIds
645645 *
646646 * @return int
647647 * @throws DatabaseException
648648 */
649- public function deleteDocuments (string $ collection , array $ internalIds , array $ permissionIds ): int
649+ public function deleteDocuments (string $ collection , array $ sequences , array $ permissionIds ): int
650650 {
651- if (empty ($ internalIds )) {
651+ if (empty ($ sequences )) {
652652 return 0 ;
653653 }
654654
@@ -657,15 +657,15 @@ public function deleteDocuments(string $collection, array $internalIds, array $p
657657
658658 $ sql = "
659659 DELETE FROM {$ this ->getSQLTable ($ name )}
660- WHERE _id IN ( " . \implode (', ' , \array_map (fn ($ index ) => ":_id_ {$ index }" , \array_keys ($ internalIds ))) . ")
660+ WHERE _id IN ( " . \implode (', ' , \array_map (fn ($ index ) => ":_id_ {$ index }" , \array_keys ($ sequences ))) . ")
661661 {$ this ->getTenantQuery ($ collection )}
662662 " ;
663663
664664 $ sql = $ this ->trigger (Database::EVENT_DOCUMENTS_DELETE , $ sql );
665665
666666 $ stmt = $ this ->getPDO ()->prepare ($ sql );
667667
668- foreach ($ internalIds as $ id => $ value ) {
668+ foreach ($ sequences as $ id => $ value ) {
669669 $ stmt ->bindValue (":_id_ {$ id }" , $ value );
670670 }
671671
@@ -718,7 +718,7 @@ public function deleteDocuments(string $collection, array $internalIds, array $p
718718 */
719719 protected function getInternalIds (string $ collection , array $ documentIds , array $ documentTenants = []): array
720720 {
721- $ internalIds = [];
721+ $ sequences = [];
722722
723723 /**
724724 * UID, _tenant bottleneck is ~ 5000 rows since we use _uid IN query
@@ -747,10 +747,10 @@ protected function getInternalIds(string $collection, array $documentIds, array
747747 $ results = $ stmt ->fetchAll (\PDO ::FETCH_KEY_PAIR ); // Fetch as [documentId => internalId]
748748 $ stmt ->closeCursor ();
749749
750- $ internalIds = [...$ internalIds , ...$ results ];
750+ $ sequences = [...$ sequences , ...$ results ];
751751 }
752752
753- return $ internalIds ;
753+ return $ sequences ;
754754 }
755755
756756 /**
@@ -1692,7 +1692,7 @@ protected function getAttributeProjection(array $selections, string $prefix = ''
16921692
16931693 $ internalKeys = [
16941694 '$id ' ,
1695- '$internalId ' ,
1695+ '$sequence ' ,
16961696 '$permissions ' ,
16971697 '$createdAt ' ,
16981698 '$updatedAt ' ,
@@ -1721,7 +1721,7 @@ protected function getInternalKeyForAttribute(string $attribute): string
17211721 {
17221722 return match ($ attribute ) {
17231723 '$id ' => '_uid ' ,
1724- '$internalId ' => '_id ' ,
1724+ '$sequence ' => '_id ' ,
17251725 '$collection ' => '_collection ' ,
17261726 '$tenant ' => '_tenant ' ,
17271727 '$createdAt ' => '_createdAt ' ,
0 commit comments