Changeset View
Changeset View
Standalone View
Standalone View
src/applications/paste/query/PhabricatorPasteQuery.php
Show First 20 Lines • Show All 104 Lines • ▼ Show 20 Lines | final class PhabricatorPasteQuery | ||||
} | } | ||||
protected function buildWhereClauseParts(AphrontDatabaseConnection $conn) { | protected function buildWhereClauseParts(AphrontDatabaseConnection $conn) { | ||||
$where = parent::buildWhereClauseParts($conn); | $where = parent::buildWhereClauseParts($conn); | ||||
if ($this->ids !== null) { | if ($this->ids !== null) { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn, | $conn, | ||||
'id IN (%Ld)', | 'paste.id IN (%Ld)', | ||||
$this->ids); | $this->ids); | ||||
} | } | ||||
if ($this->phids !== null) { | if ($this->phids !== null) { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn, | $conn, | ||||
'phid IN (%Ls)', | 'paste.phid IN (%Ls)', | ||||
$this->phids); | $this->phids); | ||||
} | } | ||||
if ($this->authorPHIDs !== null) { | if ($this->authorPHIDs !== null) { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn, | $conn, | ||||
'authorPHID IN (%Ls)', | 'paste.authorPHID IN (%Ls)', | ||||
$this->authorPHIDs); | $this->authorPHIDs); | ||||
} | } | ||||
if ($this->parentPHIDs !== null) { | if ($this->parentPHIDs !== null) { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn, | $conn, | ||||
'parentPHID IN (%Ls)', | 'paste.parentPHID IN (%Ls)', | ||||
$this->parentPHIDs); | $this->parentPHIDs); | ||||
} | } | ||||
if ($this->languages !== null) { | if ($this->languages !== null) { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn, | $conn, | ||||
'language IN (%Ls)', | 'paste.language IN (%Ls)', | ||||
$this->languages); | $this->languages); | ||||
} | } | ||||
if ($this->dateCreatedAfter !== null) { | if ($this->dateCreatedAfter !== null) { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn, | $conn, | ||||
'dateCreated >= %d', | 'paste.dateCreated >= %d', | ||||
$this->dateCreatedAfter); | $this->dateCreatedAfter); | ||||
} | } | ||||
if ($this->dateCreatedBefore !== null) { | if ($this->dateCreatedBefore !== null) { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn, | $conn, | ||||
'dateCreated <= %d', | 'paste.dateCreated <= %d', | ||||
$this->dateCreatedBefore); | $this->dateCreatedBefore); | ||||
} | } | ||||
if ($this->statuses !== null) { | if ($this->statuses !== null) { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn, | $conn, | ||||
'status IN (%Ls)', | 'paste.status IN (%Ls)', | ||||
$this->statuses); | $this->statuses); | ||||
} | } | ||||
return $where; | return $where; | ||||
} | } | ||||
protected function getPrimaryTableAlias() { | |||||
return 'paste'; | |||||
} | |||||
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(), | ||||
$paste->getLanguage(), | $paste->getLanguage(), | ||||
PhabricatorHash::digestForIndex($paste->getTitle()), | PhabricatorHash::digestForIndex($paste->getTitle()), | ||||
▲ Show 20 Lines • Show All 220 Lines • Show Last 20 Lines |