File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -509,7 +509,12 @@ public function update($update): UpdateResult
509509 throw new Exception ("You must set a filter (where query) to update records. " );
510510 }
511511
512- $ pipeline = [];
512+ // Build the pipeline
513+ if (is_object ($ this ->customPipeline ) && !empty ($ this ->customPipeline ->pipeline ) && $ this ->customPipeline ->beforeQb ) {
514+ $ pipeline = $ this ->customPipeline ->pipeline ;
515+ } else {
516+ $ pipeline = [];
517+ }
513518
514519 if (is_array ($ update )) {
515520 $ inc = [];
@@ -562,6 +567,10 @@ public function update($update): UpdateResult
562567 }
563568 }
564569
570+ if (is_object ($ this ->customPipeline ) && !empty ($ this ->customPipeline ->pipeline ) && !$ this ->customPipeline ->beforeQb ) {
571+ $ pipeline = array_merge ($ pipeline , $ this ->customPipeline ->pipeline );
572+ }
573+
565574 // Run the update query
566575 return $ this ->collection ->updateMany ($ this ->getNormalizedFilters (), $ pipeline );
567576 }
You can’t perform that action at this time.
0 commit comments