Differential D21795 Diff 51964 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 363 Lines • ▼ Show 20 Lines | final public function newIterator() { | ||||
return new PhabricatorQueryIterator($this); | 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 (phutil_nonempty_string($pager->getAfterID())) { | ||||
$this->setExternalCursorString($pager->getAfterID()); | $this->setExternalCursorString($pager->getAfterID()); | ||||
} else if ($pager->getBeforeID()) { | } else if ($pager->getBeforeID()) { | ||||
$this->setExternalCursorString($pager->getBeforeID()); | $this->setExternalCursorString($pager->getBeforeID()); | ||||
$this->setIsQueryOrderReversed(true); | $this->setIsQueryOrderReversed(true); | ||||
} | } | ||||
$results = $this->execute(); | $results = $this->execute(); | ||||
$count = count($results); | $count = count($results); | ||||
▲ Show 20 Lines • Show All 2,882 Lines • Show Last 20 Lines |