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 b56dc51..dfbaa47 100644 --- a/packages/plugin/src/Elements/Db/EventQuery.php +++ b/packages/plugin/src/Elements/Db/EventQuery.php @@ -437,6 +437,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);