Changeset View
Changeset View
Standalone View
Standalone View
src/applications/releeph/query/ReleephRequestQuery.php
Show First 20 Lines • Show All 141 Lines • ▼ Show 20 Lines | if ($keep_status) { | ||||
unset($requests[$key]); | unset($requests[$key]); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
return $requests; | return $requests; | ||||
} | } | ||||
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->branchIDs !== null) { | if ($this->branchIDs !== null) { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn_r, | $conn, | ||||
'branchID IN (%Ld)', | 'branchID IN (%Ld)', | ||||
$this->branchIDs); | $this->branchIDs); | ||||
} | } | ||||
if ($this->requestedCommitPHIDs !== null) { | if ($this->requestedCommitPHIDs !== null) { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn_r, | $conn, | ||||
'requestCommitPHID IN (%Ls)', | 'requestCommitPHID IN (%Ls)', | ||||
$this->requestedCommitPHIDs); | $this->requestedCommitPHIDs); | ||||
} | } | ||||
if ($this->requestorPHIDs !== null) { | if ($this->requestorPHIDs !== null) { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn_r, | $conn, | ||||
'requestUserPHID IN (%Ls)', | 'requestUserPHID IN (%Ls)', | ||||
$this->requestorPHIDs); | $this->requestorPHIDs); | ||||
} | } | ||||
if ($this->requestedObjectPHIDs !== null) { | if ($this->requestedObjectPHIDs !== null) { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn_r, | $conn, | ||||
'requestedObjectPHID IN (%Ls)', | 'requestedObjectPHID IN (%Ls)', | ||||
$this->requestedObjectPHIDs); | $this->requestedObjectPHIDs); | ||||
} | } | ||||
$where[] = $this->buildPagingClause($conn_r); | $where[] = $this->buildPagingClause($conn); | ||||
return $this->formatWhereClause($where); | return $this->formatWhereClause($conn, $where); | ||||
} | } | ||||
private function getKeepStatusConstants() { | private function getKeepStatusConstants() { | ||||
switch ($this->status) { | switch ($this->status) { | ||||
case self::STATUS_ALL: | case self::STATUS_ALL: | ||||
return array(); | return array(); | ||||
case self::STATUS_OPEN: | case self::STATUS_OPEN: | ||||
return array( | return array( | ||||
▲ Show 20 Lines • Show All 42 Lines • Show Last 20 Lines |