From acec8d452e8f30db769f93eb89c33612bee51ca1 Mon Sep 17 00:00:00 2001 From: Sean Delaney Date: Thu, 11 Apr 2024 15:14:34 +0100 Subject: [PATCH] fix(SFT-1021): Fixed reoccurring events not returning when using batch calls --- Batch | 0 packages/plugin/src/Elements/Db/EventQuery.php | 5 +++++ 2 files changed, 5 insertions(+) create mode 100644 Batch diff --git a/Batch b/Batch new file mode 100644 index 0000000..e69de29 diff --git a/packages/plugin/src/Elements/Db/EventQuery.php b/packages/plugin/src/Elements/Db/EventQuery.php index 5195909..eb4ee39 100644 --- a/packages/plugin/src/Elements/Db/EventQuery.php +++ b/packages/plugin/src/Elements/Db/EventQuery.php @@ -436,6 +436,11 @@ public function all($db = null): array return $this->events; } + public function batch($batchSize = null, $db = null): array + { + return array_chunk($this->all($db), $batchSize); + } + public function nth(int $n, ?Connection $db = null): null|array|Model { $this->all($db);