@@ -3529,11 +3529,11 @@ public function createDocuments(
35293529 return $ this ->adapter ->createDocuments ($ collection ->getId (), $ chunk );
35303530 });
35313531
3532- foreach ($ batch as $ document ) {
3532+ foreach ($ batch as $ doc ) {
35333533 if ($ this ->resolveRelationships ) {
3534- $ document = $ this ->silent (fn () => $ this ->populateDocumentRelationships ($ collection , $ document ));
3534+ $ doc = $ this ->silent (fn () => $ this ->populateDocumentRelationships ($ collection , $ doc ));
35353535 }
3536- $ onNext && $ onNext ($ document );
3536+ $ onNext && $ onNext ($ doc );
35373537 $ modified ++;
35383538 }
35393539 }
@@ -4795,20 +4795,20 @@ public function createOrUpdateDocumentsWithIncrease(
47954795 $ chunk
47964796 )));
47974797
4798- foreach ($ batch as $ document ) {
4798+ foreach ($ batch as $ doc ) {
47994799 if ($ this ->resolveRelationships ) {
4800- $ document = $ this ->silent (fn () => $ this ->populateDocumentRelationships ($ collection , $ document ));
4800+ $ doc = $ this ->silent (fn () => $ this ->populateDocumentRelationships ($ collection , $ doc ));
48014801 }
48024802
48034803 if ($ this ->getSharedTables () && $ this ->getTenantPerDocument ()) {
4804- $ this ->withTenant ($ document ->getTenant (), function () use ($ collection , $ document ) {
4805- $ this ->purgeCachedDocument ($ collection ->getId (), $ document ->getId ());
4804+ $ this ->withTenant ($ doc ->getTenant (), function () use ($ collection , $ doc ) {
4805+ $ this ->purgeCachedDocument ($ collection ->getId (), $ doc ->getId ());
48064806 });
48074807 } else {
4808- $ this ->purgeCachedDocument ($ collection ->getId (), $ document ->getId ());
4808+ $ this ->purgeCachedDocument ($ collection ->getId (), $ doc ->getId ());
48094809 }
48104810
4811- $ onNext && $ onNext ($ document );
4811+ $ onNext && $ onNext ($ doc );
48124812 $ modified ++;
48134813 }
48144814 }
0 commit comments