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

Modernize "PhabricatorRepositoryPushEventQuery"

Summary: Depends on D18914. Updates this Query to use slightly more modern construction while I'm working in adjacent code.

Test Plan: Viewed push logs in web UI.

Reviewers: amckinley

Reviewed By: amckinley

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

+16 -25
+16 -25
src/applications/repository/query/PhabricatorRepositoryPushEventQuery.php
··· 34 34 return $this; 35 35 } 36 36 37 + public function newResultObject() { 38 + return new PhabricatorRepositoryPushEvent(); 39 + } 40 + 37 41 protected function loadPage() { 38 - $table = new PhabricatorRepositoryPushEvent(); 39 - $conn_r = $table->establishConnection('r'); 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); 42 + return $this->loadStandardPage($this->newResultObject()); 50 43 } 51 44 52 45 protected function willFilterPage(array $events) { ··· 88 81 return $events; 89 82 } 90 83 91 - protected function buildWhereClause(AphrontDatabaseConnection $conn_r) { 92 - $where = array(); 84 + protected function buildWhereClauseParts(AphrontDatabaseConnection $conn) { 85 + $where = parent::buildWhereClauseParts($conn); 93 86 94 - if ($this->ids) { 87 + if ($this->ids !== null) { 95 88 $where[] = qsprintf( 96 - $conn_r, 89 + $conn, 97 90 'id IN (%Ld)', 98 91 $this->ids); 99 92 } 100 93 101 - if ($this->phids) { 94 + if ($this->phids !== null) { 102 95 $where[] = qsprintf( 103 - $conn_r, 96 + $conn, 104 97 'phid IN (%Ls)', 105 98 $this->phids); 106 99 } 107 100 108 - if ($this->repositoryPHIDs) { 101 + if ($this->repositoryPHIDs !== null) { 109 102 $where[] = qsprintf( 110 - $conn_r, 103 + $conn, 111 104 'repositoryPHID IN (%Ls)', 112 105 $this->repositoryPHIDs); 113 106 } 114 107 115 - if ($this->pusherPHIDs) { 108 + if ($this->pusherPHIDs !== null) { 116 109 $where[] = qsprintf( 117 - $conn_r, 110 + $conn, 118 111 'pusherPHID in (%Ls)', 119 112 $this->pusherPHIDs); 120 113 } 121 114 122 - $where[] = $this->buildPagingClause($conn_r); 123 - 124 - return $this->formatWhereClause($where); 115 + return $where; 125 116 } 126 117 127 118 public function getQueryApplicationClass() {