Changeset View
Changeset View
Standalone View
Standalone View
src/applications/fund/query/FundBackerQuery.php
| Show First 20 Lines • Show All 62 Lines • ▼ Show 20 Lines | foreach ($backers as $backer) { | ||||
| $initiative_phid = $backer->getInitiativePHID(); | $initiative_phid = $backer->getInitiativePHID(); | ||||
| $initiative = idx($initiatives, $initiative_phid); | $initiative = idx($initiatives, $initiative_phid); | ||||
| $backer->attachInitiative($initiative); | $backer->attachInitiative($initiative); | ||||
| } | } | ||||
| return $backers; | return $backers; | ||||
| } | } | ||||
| protected function buildWhereClause(AphrontDatabaseConnection $conn_r) { | protected function buildWhereClause(AphrontDatabaseConnection $conn) { | ||||
| $where = array(); | $where = array(); | ||||
| $where[] = $this->buildPagingClause($conn_r); | $where[] = $this->buildPagingClause($conn); | ||||
| if ($this->ids !== null) { | if ($this->ids !== null) { | ||||
| $where[] = qsprintf( | $where[] = qsprintf( | ||||
| $conn_r, | $conn, | ||||
| 'id IN (%Ld)', | 'id IN (%Ld)', | ||||
| $this->ids); | $this->ids); | ||||
| } | } | ||||
| if ($this->phids !== null) { | if ($this->phids !== null) { | ||||
| $where[] = qsprintf( | $where[] = qsprintf( | ||||
| $conn_r, | $conn, | ||||
| 'phid IN (%Ls)', | 'phid IN (%Ls)', | ||||
| $this->phids); | $this->phids); | ||||
| } | } | ||||
| if ($this->initiativePHIDs !== null) { | if ($this->initiativePHIDs !== null) { | ||||
| $where[] = qsprintf( | $where[] = qsprintf( | ||||
| $conn_r, | $conn, | ||||
| 'initiativePHID IN (%Ls)', | 'initiativePHID IN (%Ls)', | ||||
| $this->initiativePHIDs); | $this->initiativePHIDs); | ||||
| } | } | ||||
| if ($this->backerPHIDs !== null) { | if ($this->backerPHIDs !== null) { | ||||
| $where[] = qsprintf( | $where[] = qsprintf( | ||||
| $conn_r, | $conn, | ||||
| 'backerPHID IN (%Ls)', | 'backerPHID IN (%Ls)', | ||||
| $this->backerPHIDs); | $this->backerPHIDs); | ||||
| } | } | ||||
| if ($this->statuses !== null) { | if ($this->statuses !== null) { | ||||
| $where[] = qsprintf( | $where[] = qsprintf( | ||||
| $conn_r, | $conn, | ||||
| 'status IN (%Ls)', | 'status IN (%Ls)', | ||||
| $this->statuses); | $this->statuses); | ||||
| } | } | ||||
| return $this->formatWhereClause($where); | return $this->formatWhereClause($conn, $where); | ||||
| } | } | ||||
| public function getQueryApplicationClass() { | public function getQueryApplicationClass() { | ||||
| return 'PhabricatorFundApplication'; | return 'PhabricatorFundApplication'; | ||||
| } | } | ||||
| } | } | ||||