Differential D13322 Diff 32241 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 866 Lines • ▼ Show 20 Lines | protected function getDefaultOrderVector() { | ||||
| return array('id'); | return array('id'); | ||||
| } | } | ||||
| /** | /** | ||||
| * @task order | * @task order | ||||
| */ | */ | ||||
| public function getOrderableColumns() { | public function getOrderableColumns() { | ||||
| $cache = PhabricatorCaches::getRequestCache(); | |||||
| $class = get_class($this); | |||||
| $cache_key = 'query.orderablecolumns.'.$class; | |||||
| $columns = $cache->getKey($cache_key); | |||||
| if ($columns !== null) { | |||||
| return $columns; | |||||
| } | |||||
| $columns = array( | $columns = array( | ||||
| 'id' => array( | 'id' => array( | ||||
| 'table' => $this->getPrimaryTableAlias(), | 'table' => $this->getPrimaryTableAlias(), | ||||
| 'column' => 'id', | 'column' => 'id', | ||||
| 'reverse' => false, | 'reverse' => false, | ||||
| 'type' => 'int', | 'type' => 'int', | ||||
| 'unique' => true, | 'unique' => true, | ||||
| ), | ), | ||||
| Show All 21 Lines | if ($object instanceof PhabricatorCustomFieldInterface) { | ||||
| 'null' => 'tail', | 'null' => 'tail', | ||||
| 'customfield' => true, | 'customfield' => true, | ||||
| 'customfield.index.table' => $index->getTableName(), | 'customfield.index.table' => $index->getTableName(), | ||||
| 'customfield.index.key' => $digest, | 'customfield.index.key' => $digest, | ||||
| ); | ); | ||||
| } | } | ||||
| } | } | ||||
| $cache->setKey($cache_key, $columns); | |||||
| return $columns; | return $columns; | ||||
| } | } | ||||
| /** | /** | ||||
| * @task order | * @task order | ||||
| */ | */ | ||||
| final protected function buildOrderClause(AphrontDatabaseConnection $conn) { | final protected function buildOrderClause(AphrontDatabaseConnection $conn) { | ||||
| ▲ Show 20 Lines • Show All 933 Lines • Show Last 20 Lines | |||||