diff --git a/src/applications/base/controller/PhabricatorController.php b/src/applications/base/controller/PhabricatorController.php --- a/src/applications/base/controller/PhabricatorController.php +++ b/src/applications/base/controller/PhabricatorController.php @@ -559,7 +559,6 @@ ->setViewer($viewer) ->withObjectPHIDs(array($object->getPHID())) ->needComments(true) - ->setReversePaging(false) ->executeWithCursorPager($pager); $xactions = array_reverse($xactions); diff --git a/src/applications/config/controller/PhabricatorConfigHistoryController.php b/src/applications/config/controller/PhabricatorConfigHistoryController.php --- a/src/applications/config/controller/PhabricatorConfigHistoryController.php +++ b/src/applications/config/controller/PhabricatorConfigHistoryController.php @@ -3,7 +3,6 @@ final class PhabricatorConfigHistoryController extends PhabricatorConfigController { - public function processRequest() { $request = $this->getRequest(); $user = $request->getUser(); @@ -11,7 +10,6 @@ $xactions = id(new PhabricatorConfigTransactionQuery()) ->setViewer($user) ->needComments(true) - ->setReversePaging(false) ->execute(); $object = new PhabricatorConfigEntry(); diff --git a/src/applications/conpherence/query/ConpherenceTransactionQuery.php b/src/applications/conpherence/query/ConpherenceTransactionQuery.php --- a/src/applications/conpherence/query/ConpherenceTransactionQuery.php +++ b/src/applications/conpherence/query/ConpherenceTransactionQuery.php @@ -7,8 +7,9 @@ return new ConpherenceTransaction(); } - protected function getReversePaging() { - return false; + protected function getDefaultOrderVector() { + // TODO: Can we get rid of this? + return array('-id'); } } diff --git a/src/applications/differential/query/DifferentialHunkQuery.php b/src/applications/differential/query/DifferentialHunkQuery.php --- a/src/applications/differential/query/DifferentialHunkQuery.php +++ b/src/applications/differential/query/DifferentialHunkQuery.php @@ -112,8 +112,9 @@ return 'PhabricatorDifferentialApplication'; } - protected function getReversePaging() { - return true; + protected function getDefaultOrderVector() { + // TODO: Do we need this? + return array('-id'); } } diff --git a/src/applications/ponder/query/PonderAnswerQuery.php b/src/applications/ponder/query/PonderAnswerQuery.php --- a/src/applications/ponder/query/PonderAnswerQuery.php +++ b/src/applications/ponder/query/PonderAnswerQuery.php @@ -118,10 +118,6 @@ return $answers; } - protected function getReversePaging() { - return true; - } - public function getQueryApplicationClass() { return 'PhabricatorPonderApplication'; } diff --git a/src/applications/ponder/query/PonderQuestionQuery.php b/src/applications/ponder/query/PonderQuestionQuery.php --- a/src/applications/ponder/query/PonderQuestionQuery.php +++ b/src/applications/ponder/query/PonderQuestionQuery.php @@ -141,6 +141,7 @@ if ($this->needAnswers) { $aquery = id(new PonderAnswerQuery()) ->setViewer($this->getViewer()) + ->setOrderVector(array('-id')) ->withQuestionIDs(mpull($questions, 'getID')); if ($this->needViewerVotes) { diff --git a/src/applications/repository/query/PhabricatorRepositoryQuery.php b/src/applications/repository/query/PhabricatorRepositoryQuery.php --- a/src/applications/repository/query/PhabricatorRepositoryQuery.php +++ b/src/applications/repository/query/PhabricatorRepositoryQuery.php @@ -312,7 +312,7 @@ return $repositories; } - public function getPrimaryTableAlias() { + protected function getPrimaryTableAlias() { return 'r'; } diff --git a/src/applications/transactions/query/PhabricatorApplicationTransactionQuery.php b/src/applications/transactions/query/PhabricatorApplicationTransactionQuery.php --- a/src/applications/transactions/query/PhabricatorApplicationTransactionQuery.php +++ b/src/applications/transactions/query/PhabricatorApplicationTransactionQuery.php @@ -7,7 +7,6 @@ private $objectPHIDs; private $authorPHIDs; private $transactionTypes; - private $reversePaging = true; private $needComments = true; private $needHandles = true; @@ -18,15 +17,6 @@ return array(); } - public function setReversePaging($bool) { - $this->reversePaging = $bool; - return $this; - } - - protected function getReversePaging() { - return $this->reversePaging; - } - public function withPHIDs(array $phids) { $this->phids = $phids; return $this; diff --git a/src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php b/src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php --- a/src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php +++ b/src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php @@ -18,10 +18,6 @@ private $internalPaging; private $orderVector; - protected function getPagingColumn() { - return 'id'; - } - protected function getPagingValue($result) { if (!is_object($result)) { // This interface can't be typehinted and PHP gets really angry if we @@ -31,10 +27,6 @@ return $result->getID(); } - protected function getReversePaging() { - return false; - } - protected function nextPage(array $page) { // See getPagingViewer() for a description of this flag. $this->internalPaging = true; @@ -171,28 +163,6 @@ protected function buildPagingClause(AphrontDatabaseConnection $conn) { $orderable = $this->getOrderableColumns(); - - // TODO: Remove this once subqueries modernize. - if (!$orderable) { - if ($this->beforeID) { - return qsprintf( - $conn, - '%Q %Q %s', - $this->getPagingColumn(), - $this->getReversePaging() ? '<' : '>', - $this->beforeID); - } else if ($this->afterID) { - return qsprintf( - $conn, - '%Q %Q %s', - $this->getPagingColumn(), - $this->getReversePaging() ? '>' : '<', - $this->afterID); - } else { - return null; - } - } - $vector = $this->getOrderVector(); if ($this->beforeID !== null) { @@ -543,13 +513,6 @@ * @task order */ public function getOrderableColumns() { - // TODO: Remove this once all subclasses move off the old stuff. - if ($this->getPagingColumn() !== 'id') { - // This class has bad old custom logic around paging, so return nothing - // here. This deactivates the new order code. - return array(); - } - $columns = array( 'id' => array( 'table' => $this->getPrimaryTableAlias(), @@ -593,26 +556,6 @@ */ final protected function buildOrderClause(AphrontDatabaseConnection $conn) { $orderable = $this->getOrderableColumns(); - - // TODO: Remove this once all subclasses move off the old stuff. We'll - // only enter this block for code using older ordering mechanisms. New - // code should expose an orderable column list. - if (!$orderable) { - if ($this->beforeID) { - return qsprintf( - $conn, - 'ORDER BY %Q %Q', - $this->getPagingColumn(), - $this->getReversePaging() ? 'DESC' : 'ASC'); - } else { - return qsprintf( - $conn, - 'ORDER BY %Q %Q', - $this->getPagingColumn(), - $this->getReversePaging() ? 'ASC' : 'DESC'); - } - } - $vector = $this->getOrderVector(); $parts = array(); @@ -636,10 +579,6 @@ array $parts) { $is_query_reversed = false; - if ($this->getReversePaging()) { - $is_query_reversed = !$is_query_reversed; - } - if ($this->getBeforeID()) { $is_query_reversed = !$is_query_reversed; }