Differential D21015 Diff 50078 src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php
Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php
Show First 20 Lines • Show All 353 Lines • ▼ Show 20 Lines | /* -( Cursors )------------------------------------------------------------ */ | ||||
final protected function didLoadResults(array $results) { | final protected function didLoadResults(array $results) { | ||||
if ($this->getIsQueryOrderReversed()) { | if ($this->getIsQueryOrderReversed()) { | ||||
$results = array_reverse($results, $preserve_keys = true); | $results = array_reverse($results, $preserve_keys = true); | ||||
} | } | ||||
return $results; | return $results; | ||||
} | } | ||||
final public function newIterator() { | |||||
return new PhabricatorQueryIterator($this); | |||||
} | |||||
final public function executeWithCursorPager(AphrontCursorPagerView $pager) { | final public function executeWithCursorPager(AphrontCursorPagerView $pager) { | ||||
$limit = $pager->getPageSize(); | $limit = $pager->getPageSize(); | ||||
$this->setLimit($limit + 1); | $this->setLimit($limit + 1); | ||||
if (strlen($pager->getAfterID())) { | if (strlen($pager->getAfterID())) { | ||||
$this->setExternalCursorString($pager->getAfterID()); | $this->setExternalCursorString($pager->getAfterID()); | ||||
} else if ($pager->getBeforeID()) { | } else if ($pager->getBeforeID()) { | ||||
▲ Show 20 Lines • Show All 2,816 Lines • Show Last 20 Lines |