@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.

Lightly modernize FundInitiativeQuery

Summary: Ref T12819. Prepares Fund to move to Ferret.

Test Plan: Searched for initiatives in Fund.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T12819

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

+12 -21
+12 -21
src/applications/fund/query/FundInitiativeQuery.php
··· 35 35 return $this; 36 36 } 37 37 38 + public function newResultObject() { 39 + return new FundInitiative(); 40 + } 41 + 38 42 protected function loadPage() { 39 - $table = new FundInitiative(); 40 - $conn_r = $table->establishConnection('r'); 41 - 42 - $rows = queryfx_all( 43 - $conn_r, 44 - 'SELECT * FROM %T %Q %Q %Q', 45 - $table->getTableName(), 46 - $this->buildWhereClause($conn_r), 47 - $this->buildOrderClause($conn_r), 48 - $this->buildLimitClause($conn_r)); 49 - 50 - return $table->loadAllFromArray($rows); 43 + return $this->loadStandardPage($this->newResultObject()); 51 44 } 52 45 53 46 protected function didFilterPage(array $initiatives) { ··· 73 66 return $initiatives; 74 67 } 75 68 76 - protected function buildWhereClause(AphrontDatabaseConnection $conn_r) { 77 - $where = array(); 78 - 79 - $where[] = $this->buildPagingClause($conn_r); 69 + protected function buildWhereClauseParts(AphrontDatabaseConnection $conn) { 70 + $where = parent::buildWhereClauseParts($conn); 80 71 81 72 if ($this->ids !== null) { 82 73 $where[] = qsprintf( 83 - $conn_r, 74 + $conn, 84 75 'id IN (%Ld)', 85 76 $this->ids); 86 77 } 87 78 88 79 if ($this->phids !== null) { 89 80 $where[] = qsprintf( 90 - $conn_r, 81 + $conn, 91 82 'phid IN (%Ls)', 92 83 $this->phids); 93 84 } 94 85 95 86 if ($this->ownerPHIDs !== null) { 96 87 $where[] = qsprintf( 97 - $conn_r, 88 + $conn, 98 89 'ownerPHID IN (%Ls)', 99 90 $this->ownerPHIDs); 100 91 } 101 92 102 93 if ($this->statuses !== null) { 103 94 $where[] = qsprintf( 104 - $conn_r, 95 + $conn, 105 96 'status IN (%Ls)', 106 97 $this->statuses); 107 98 } 108 99 109 - return $this->formatWhereClause($where); 100 + return $where; 110 101 } 111 102 112 103 public function getQueryApplicationClass() {