Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/query/DifferentialDiffQuery.php
<?php | <?php | ||||
final class DifferentialDiffQuery | final class DifferentialDiffQuery | ||||
extends PhabricatorCursorPagedPolicyAwareQuery { | extends PhabricatorCursorPagedPolicyAwareQuery { | ||||
private $ids; | private $ids; | ||||
private $phids; | |||||
private $revisionIDs; | private $revisionIDs; | ||||
private $needChangesets = false; | private $needChangesets = false; | ||||
private $needArcanistProjects = false; | private $needArcanistProjects = false; | ||||
public function withIDs(array $ids) { | public function withIDs(array $ids) { | ||||
$this->ids = $ids; | $this->ids = $ids; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function withPHIDs(array $phids) { | |||||
$this->phids = $phids; | |||||
return $this; | |||||
} | |||||
public function withRevisionIDs(array $revision_ids) { | public function withRevisionIDs(array $revision_ids) { | ||||
$this->revisionIDs = $revision_ids; | $this->revisionIDs = $revision_ids; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function needChangesets($bool) { | public function needChangesets($bool) { | ||||
$this->needChangesets = $bool; | $this->needChangesets = $bool; | ||||
return $this; | return $this; | ||||
▲ Show 20 Lines • Show All 97 Lines • ▼ Show 20 Lines | private function buildWhereClause(AphrontDatabaseConnection $conn_r) { | ||||
if ($this->ids) { | if ($this->ids) { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn_r, | $conn_r, | ||||
'id IN (%Ld)', | 'id IN (%Ld)', | ||||
$this->ids); | $this->ids); | ||||
} | } | ||||
if ($this->phids) { | |||||
$where[] = qsprintf( | |||||
$conn_r, | |||||
'phid IN (%Ls)', | |||||
$this->phids); | |||||
} | |||||
if ($this->revisionIDs) { | if ($this->revisionIDs) { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn_r, | $conn_r, | ||||
'revisionID IN (%Ld)', | 'revisionID IN (%Ld)', | ||||
$this->revisionIDs); | $this->revisionIDs); | ||||
} | } | ||||
$where[] = $this->buildPagingClause($conn_r); | $where[] = $this->buildPagingClause($conn_r); | ||||
return $this->formatWhereClause($where); | return $this->formatWhereClause($where); | ||||
} | } | ||||
public function getQueryApplicationClass() { | public function getQueryApplicationClass() { | ||||
return 'PhabricatorApplicationDifferential'; | return 'PhabricatorApplicationDifferential'; | ||||
} | } | ||||
} | } |