mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-24 06:20:56 +01:00
Modernize ProjectQuery paging/ordering
Summary: Ref T7803. Move ProjectQuery off getReversePaging() / getPagingColumn() and onto order vectors. Test Plan: Set project page size to 3 and paged back and forth. Reviewers: btrahan Reviewed By: btrahan Subscribers: epriestley Maniphest Tasks: T7803 Differential Revision: https://secure.phabricator.com/D12357
This commit is contained in:
parent
4fba6e7730
commit
d496f4d28c
1 changed files with 20 additions and 6 deletions
|
@ -95,18 +95,32 @@ final class PhabricatorProjectQuery
|
|||
return $this;
|
||||
}
|
||||
|
||||
protected function getPagingColumn() {
|
||||
return 'name';
|
||||
protected function getDefaultOrderVector() {
|
||||
return array('name');
|
||||
}
|
||||
|
||||
public function getOrderableColumns() {
|
||||
return array(
|
||||
'name' => array(
|
||||
'table' => $this->getPrimaryTableAlias(),
|
||||
'column' => 'name',
|
||||
'reverse' => true,
|
||||
'type' => 'string',
|
||||
'unique' => true,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
protected function getPagingValueMap($cursor, array $keys) {
|
||||
return array(
|
||||
'name' => $cursor,
|
||||
);
|
||||
}
|
||||
|
||||
protected function getPagingValue($result) {
|
||||
return $result->getName();
|
||||
}
|
||||
|
||||
protected function getReversePaging() {
|
||||
return true;
|
||||
}
|
||||
|
||||
protected function loadPage() {
|
||||
$table = new PhabricatorProject();
|
||||
$conn_r = $table->establishConnection('r');
|
||||
|
|
Loading…
Reference in a new issue