Differential D19789 Diff 47303 src/applications/transactions/query/PhabricatorApplicationTransactionCommentQuery.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/transactions/query/PhabricatorApplicationTransactionCommentQuery.php
Show First 20 Lines • Show All 51 Lines • ▼ Show 20 Lines | $data = queryfx_all( | ||||
$table->getTableName(), | $table->getTableName(), | ||||
$this->buildWhereClause($conn_r), | $this->buildWhereClause($conn_r), | ||||
$this->buildOrderClause($conn_r), | $this->buildOrderClause($conn_r), | ||||
$this->buildLimitClause($conn_r)); | $this->buildLimitClause($conn_r)); | ||||
return $table->loadAllFromArray($data); | return $table->loadAllFromArray($data); | ||||
} | } | ||||
protected function buildWhereClause(AphrontDatabaseConnection $conn_r) { | protected function buildWhereClause(AphrontDatabaseConnection $conn) { | ||||
return $this->formatWhereClause($this->buildWhereClauseComponents($conn_r)); | return $this->formatWhereClause( | ||||
$conn, | |||||
$this->buildWhereClauseComponents($conn)); | |||||
} | } | ||||
protected function buildWhereClauseComponents( | protected function buildWhereClauseComponents( | ||||
AphrontDatabaseConnection $conn_r) { | AphrontDatabaseConnection $conn) { | ||||
$where = array(); | $where = array(); | ||||
if ($this->ids !== null) { | if ($this->ids !== null) { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn_r, | $conn, | ||||
'xcomment.id IN (%Ld)', | 'xcomment.id IN (%Ld)', | ||||
$this->ids); | $this->ids); | ||||
} | } | ||||
if ($this->phids !== null) { | if ($this->phids !== null) { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn_r, | $conn, | ||||
'xcomment.phid IN (%Ls)', | 'xcomment.phid IN (%Ls)', | ||||
$this->phids); | $this->phids); | ||||
} | } | ||||
if ($this->authorPHIDs !== null) { | if ($this->authorPHIDs !== null) { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn_r, | $conn, | ||||
'xcomment.authorPHID IN (%Ls)', | 'xcomment.authorPHID IN (%Ls)', | ||||
$this->authorPHIDs); | $this->authorPHIDs); | ||||
} | } | ||||
if ($this->transactionPHIDs !== null) { | if ($this->transactionPHIDs !== null) { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn_r, | $conn, | ||||
'xcomment.transactionPHID IN (%Ls)', | 'xcomment.transactionPHID IN (%Ls)', | ||||
$this->transactionPHIDs); | $this->transactionPHIDs); | ||||
} | } | ||||
if ($this->isDeleted !== null) { | if ($this->isDeleted !== null) { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn_r, | $conn, | ||||
'xcomment.isDeleted = %d', | 'xcomment.isDeleted = %d', | ||||
(int)$this->isDeleted); | (int)$this->isDeleted); | ||||
} | } | ||||
if ($this->hasTransaction !== null) { | if ($this->hasTransaction !== null) { | ||||
if ($this->hasTransaction) { | if ($this->hasTransaction) { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn_r, | $conn, | ||||
'xcomment.transactionPHID IS NOT NULL'); | 'xcomment.transactionPHID IS NOT NULL'); | ||||
} else { | } else { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn_r, | $conn, | ||||
'xcomment.transactionPHID IS NULL'); | 'xcomment.transactionPHID IS NULL'); | ||||
} | } | ||||
} | } | ||||
return $where; | return $where; | ||||
} | } | ||||
public function getQueryApplicationClass() { | public function getQueryApplicationClass() { | ||||
// TODO: Figure out the app via the template? | // TODO: Figure out the app via the template? | ||||
return null; | return null; | ||||
} | } | ||||
} | } |