Changeset View
Changeset View
Standalone View
Standalone View
src/applications/paste/query/PhabricatorPasteQuery.php
Show First 20 Lines • Show All 90 Lines • ▼ Show 20 Lines | protected function didFilterPage(array $pastes) { | ||||
if ($this->needContent) { | if ($this->needContent) { | ||||
$pastes = $this->loadContent($pastes); | $pastes = $this->loadContent($pastes); | ||||
} | } | ||||
return $pastes; | return $pastes; | ||||
} | } | ||||
protected function buildWhereClause(AphrontDatabaseConnection $conn_r) { | protected function buildWhereClauseParts(AphrontDatabaseConnection $conn) { | ||||
$where = array(); | $where = parent::buildWhereClauseParts($conn); | ||||
$where[] = $this->buildPagingClause($conn_r); | |||||
if ($this->ids) { | if ($this->ids) { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn_r, | $conn, | ||||
'id IN (%Ld)', | 'id IN (%Ld)', | ||||
$this->ids); | $this->ids); | ||||
} | } | ||||
if ($this->phids) { | if ($this->phids) { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn_r, | $conn, | ||||
'phid IN (%Ls)', | 'phid IN (%Ls)', | ||||
$this->phids); | $this->phids); | ||||
} | } | ||||
if ($this->authorPHIDs) { | if ($this->authorPHIDs) { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn_r, | $conn, | ||||
'authorPHID IN (%Ls)', | 'authorPHID IN (%Ls)', | ||||
$this->authorPHIDs); | $this->authorPHIDs); | ||||
} | } | ||||
if ($this->parentPHIDs) { | if ($this->parentPHIDs) { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn_r, | $conn, | ||||
'parentPHID IN (%Ls)', | 'parentPHID IN (%Ls)', | ||||
$this->parentPHIDs); | $this->parentPHIDs); | ||||
} | } | ||||
if ($this->languages) { | if ($this->languages) { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn_r, | $conn, | ||||
'language IN (%Ls)', | 'language IN (%Ls)', | ||||
$this->languages); | $this->languages); | ||||
} | } | ||||
if ($this->dateCreatedAfter) { | if ($this->dateCreatedAfter) { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn_r, | $conn, | ||||
'dateCreated >= %d', | 'dateCreated >= %d', | ||||
$this->dateCreatedAfter); | $this->dateCreatedAfter); | ||||
} | } | ||||
if ($this->dateCreatedBefore) { | if ($this->dateCreatedBefore) { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn_r, | $conn, | ||||
'dateCreated <= %d', | 'dateCreated <= %d', | ||||
$this->dateCreatedBefore); | $this->dateCreatedBefore); | ||||
} | } | ||||
return $this->formatWhereClause($where); | return $where; | ||||
} | } | ||||
private function getContentCacheKey(PhabricatorPaste $paste) { | private function getContentCacheKey(PhabricatorPaste $paste) { | ||||
return implode( | return implode( | ||||
':', | ':', | ||||
array( | array( | ||||
'P'.$paste->getID(), | 'P'.$paste->getID(), | ||||
$paste->getFilePHID(), | $paste->getFilePHID(), | ||||
▲ Show 20 Lines • Show All 108 Lines • Show Last 20 Lines |