@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Slightly modernize ConduitTokenQuery

Summary: Ref T11954. This old query class can use slightly more modern code.

Test Plan: Ran Conduit methods, verified results are unchanged.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11954

Differential Revision: https://secure.phabricator.com/D16996

+14 -23
+14 -23
src/applications/conduit/query/PhabricatorConduitTokenQuery.php
··· 34 34 return $this; 35 35 } 36 36 37 - protected function loadPage() { 38 - $table = new PhabricatorConduitToken(); 39 - $conn_r = $table->establishConnection('r'); 37 + public function newResultObject() { 38 + return new PhabricatorConduitToken(); 39 + } 40 40 41 - $data = queryfx_all( 42 - $conn_r, 43 - 'SELECT * FROM %T %Q %Q %Q', 44 - $table->getTableName(), 45 - $this->buildWhereClause($conn_r), 46 - $this->buildOrderClause($conn_r), 47 - $this->buildLimitClause($conn_r)); 48 - 49 - return $table->loadAllFromArray($data); 41 + protected function loadPage() { 42 + return $this->loadStandardPage($this->newResultObject()); 50 43 } 51 44 52 - protected function buildWhereClause(AphrontDatabaseConnection $conn_r) { 53 - $where = array(); 45 + protected function buildWhereClauseParts(AphrontDatabaseConnection $conn) { 46 + $where = parent::buildWhereClauseParts($conn); 54 47 55 48 if ($this->ids !== null) { 56 49 $where[] = qsprintf( 57 - $conn_r, 50 + $conn, 58 51 'id IN (%Ld)', 59 52 $this->ids); 60 53 } 61 54 62 55 if ($this->objectPHIDs !== null) { 63 56 $where[] = qsprintf( 64 - $conn_r, 57 + $conn, 65 58 'objectPHID IN (%Ls)', 66 59 $this->objectPHIDs); 67 60 } 68 61 69 62 if ($this->tokens !== null) { 70 63 $where[] = qsprintf( 71 - $conn_r, 64 + $conn, 72 65 'token IN (%Ls)', 73 66 $this->tokens); 74 67 } 75 68 76 69 if ($this->tokenTypes !== null) { 77 70 $where[] = qsprintf( 78 - $conn_r, 71 + $conn, 79 72 'tokenType IN (%Ls)', 80 73 $this->tokenTypes); 81 74 } ··· 83 76 if ($this->expired !== null) { 84 77 if ($this->expired) { 85 78 $where[] = qsprintf( 86 - $conn_r, 79 + $conn, 87 80 'expires <= %d', 88 81 PhabricatorTime::getNow()); 89 82 } else { 90 83 $where[] = qsprintf( 91 - $conn_r, 84 + $conn, 92 85 'expires IS NULL OR expires > %d', 93 86 PhabricatorTime::getNow()); 94 87 } 95 88 } 96 89 97 - $where[] = $this->buildPagingClause($conn_r); 98 - 99 - return $this->formatWhereClause($where); 90 + return $where; 100 91 } 101 92 102 93 protected function willFilterPage(array $tokens) {