Changeset View
Changeset View
Standalone View
Standalone View
src/applications/releeph/query/ReleephBranchQuery.php
| Show First 20 Lines • Show All 97 Lines • ▼ Show 20 Lines | if ($this->needCutPointCommits) { | ||||
| $commit = idx($commits, $branch->getCutPointCommitPHID()); | $commit = idx($commits, $branch->getCutPointCommitPHID()); | ||||
| $branch->attachCutPointCommit($commit); | $branch->attachCutPointCommit($commit); | ||||
| } | } | ||||
| } | } | ||||
| return $branches; | return $branches; | ||||
| } | } | ||||
| protected function buildWhereClause(AphrontDatabaseConnection $conn_r) { | protected function buildWhereClause(AphrontDatabaseConnection $conn) { | ||||
| $where = array(); | $where = array(); | ||||
| 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->productIDs !== null) { | if ($this->productIDs !== null) { | ||||
| $where[] = qsprintf( | $where[] = qsprintf( | ||||
| $conn_r, | $conn, | ||||
| 'releephProjectID IN (%Ld)', | 'releephProjectID IN (%Ld)', | ||||
| $this->productIDs); | $this->productIDs); | ||||
| } | } | ||||
| $status = $this->status; | $status = $this->status; | ||||
| switch ($status) { | switch ($status) { | ||||
| case self::STATUS_ALL: | case self::STATUS_ALL: | ||||
| break; | break; | ||||
| case self::STATUS_OPEN: | case self::STATUS_OPEN: | ||||
| $where[] = qsprintf( | $where[] = qsprintf( | ||||
| $conn_r, | $conn, | ||||
| 'isActive = 1'); | 'isActive = 1'); | ||||
| break; | break; | ||||
| default: | default: | ||||
| throw new Exception(pht("Unknown status constant '%s'!", $status)); | throw new Exception(pht("Unknown status constant '%s'!", $status)); | ||||
| } | } | ||||
| $where[] = $this->buildPagingClause($conn_r); | $where[] = $this->buildPagingClause($conn); | ||||
| return $this->formatWhereClause($where); | return $this->formatWhereClause($conn, $where); | ||||
| } | } | ||||
| public function getQueryApplicationClass() { | public function getQueryApplicationClass() { | ||||
| return 'PhabricatorReleephApplication'; | return 'PhabricatorReleephApplication'; | ||||
| } | } | ||||
| } | } | ||||