File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change 71
71
* - `keyed(): [key => object]`
72
72
* - `iterator(): iterable<object>`
73
73
* - `batch($size): iterable<object[]>`
74
+ * - `each($size): iterable<object>`
74
75
*
75
76
* @package karmabunny\pdb
76
77
*/
@@ -1050,6 +1051,24 @@ public function batch(int $size): Generator
1050
1051
}
1051
1052
1052
1053
1054
+ /**
1055
+ *
1056
+ * @param int $size
1057
+ * @return Generator
1058
+ * @throws InvalidArgumentException
1059
+ * @throws QueryException
1060
+ * @throws ConnectionException
1061
+ */
1062
+ public function each (int $ size ): Generator
1063
+ {
1064
+ foreach ($ this ->batch ($ size ) as $ results ) {
1065
+ foreach ($ results as $ result ) {
1066
+ yield $ result ;
1067
+ }
1068
+ }
1069
+ }
1070
+
1071
+
1053
1072
/**
1054
1073
*
1055
1074
* @param array|string|null $key
You can’t perform that action at this time.
0 commit comments