3 final class PhabricatorQueryIterator
extends PhutilBufferedIterator
{
8 public function __construct(PhabricatorCursorPagedPolicyAwareQuery
$query) {
12 protected function didRewind() {
13 $pager = new AphrontCursorPagerView();
15 $page_size = $this->getPageSize();
16 $pager->setPageSize($page_size);
18 $this->pager
= $pager;
21 public function key() {
22 return $this->current()->getID();
25 protected function loadPage() {
30 $pager = clone $this->pager
;
31 $query = clone $this->query
;
33 $query->setDisableOverheating(true);
35 $results = $query->executeWithCursorPager($pager);
37 // If we got less than a full page of results, this was the last set of
38 // results. Throw away the pager so we end iteration.
39 if (!$pager->getHasMoreResults()) {
42 $this->pager
->setAfterID($pager->getNextPageID());