File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -113,6 +113,26 @@ public function getPreviousPage(): ?static
113
113
return $ this ->getOffset ($ this ->getPreviousOffset ());
114
114
}
115
115
116
+ /**
117
+ * Get all results from this page and all following pages.
118
+ * This will request each page from the api one by one.
119
+ *
120
+ * When called on the first page this will return all results.
121
+ *
122
+ * @throws ApiException
123
+ * @return T[]
124
+ */
125
+ public function getResultsFromFollowingPages (): array
126
+ {
127
+ $ results = $ this ->getResults ();
128
+ $ nextPage = $ this ->getNextPage ();
129
+ while ($ nextPage !== null ) {
130
+ array_push ($ results , ...$ nextPage ->getResults ());
131
+ $ nextPage = $ nextPage ->getNextPage ();
132
+ }
133
+ return $ results ;
134
+ }
135
+
116
136
/**
117
137
* @inheritDoc
118
138
* @return T
You can’t perform that action at this time.
0 commit comments