Changeset View
Changeset View
Standalone View
Standalone View
src/applications/legalpad/query/LegalpadDocumentSignatureQuery.php
Show First 20 Lines • Show All 80 Lines • ▼ Show 20 Lines | foreach ($signatures as $key => $signature) { | ||||
} else { | } else { | ||||
unset($signatures[$key]); | unset($signatures[$key]); | ||||
} | } | ||||
} | } | ||||
return $signatures; | return $signatures; | ||||
} | } | ||||
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->documentPHIDs !== null) { | if ($this->documentPHIDs !== null) { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn_r, | $conn, | ||||
'documentPHID IN (%Ls)', | 'documentPHID IN (%Ls)', | ||||
$this->documentPHIDs); | $this->documentPHIDs); | ||||
} | } | ||||
if ($this->signerPHIDs !== null) { | if ($this->signerPHIDs !== null) { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn_r, | $conn, | ||||
'signerPHID IN (%Ls)', | 'signerPHID IN (%Ls)', | ||||
$this->signerPHIDs); | $this->signerPHIDs); | ||||
} | } | ||||
if ($this->documentVersions !== null) { | if ($this->documentVersions !== null) { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn_r, | $conn, | ||||
'documentVersion IN (%Ld)', | 'documentVersion IN (%Ld)', | ||||
$this->documentVersions); | $this->documentVersions); | ||||
} | } | ||||
if ($this->secretKeys !== null) { | if ($this->secretKeys !== null) { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn_r, | $conn, | ||||
'secretKey IN (%Ls)', | 'secretKey IN (%Ls)', | ||||
$this->secretKeys); | $this->secretKeys); | ||||
} | } | ||||
if ($this->nameContains !== null) { | if ($this->nameContains !== null) { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn_r, | $conn, | ||||
'signerName LIKE %~', | 'signerName LIKE %~', | ||||
$this->nameContains); | $this->nameContains); | ||||
} | } | ||||
if ($this->emailContains !== null) { | if ($this->emailContains !== null) { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn_r, | $conn, | ||||
'signerEmail LIKE %~', | 'signerEmail LIKE %~', | ||||
$this->emailContains); | $this->emailContains); | ||||
} | } | ||||
return $this->formatWhereClause($where); | return $this->formatWhereClause($conn, $where); | ||||
} | } | ||||
public function getQueryApplicationClass() { | public function getQueryApplicationClass() { | ||||
return 'PhabricatorLegalpadApplication'; | return 'PhabricatorLegalpadApplication'; | ||||
} | } | ||||
} | } |