Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/query/DiffusionCommitQuery.php
<?php | <?php | ||||
final class DiffusionCommitQuery | final class DiffusionCommitQuery | ||||
extends PhabricatorCursorPagedPolicyAwareQuery { | extends PhabricatorCursorPagedPolicyAwareQuery { | ||||
private $ids; | private $ids; | ||||
private $phids; | private $phids; | ||||
private $authorPHIDs; | private $authorPHIDs; | ||||
private $defaultRepository; | private $defaultRepository; | ||||
private $identifiers; | private $identifiers; | ||||
private $repositoryIDs; | private $repositoryIDs; | ||||
private $repositoryPHIDs; | private $repositoryPHIDs; | ||||
private $identifierMap; | private $identifierMap; | ||||
private $responsiblePHIDs; | private $responsiblePHIDs; | ||||
private $statuses; | private $statuses; | ||||
private $packagePHIDs; | private $packagePHIDs; | ||||
private $unreachable; | |||||
private $needAuditRequests; | private $needAuditRequests; | ||||
private $auditIDs; | private $auditIDs; | ||||
private $auditorPHIDs; | private $auditorPHIDs; | ||||
private $epochMin; | private $epochMin; | ||||
private $epochMax; | private $epochMax; | ||||
private $importing; | private $importing; | ||||
▲ Show 20 Lines • Show All 100 Lines • ▼ Show 20 Lines | public function withResponsiblePHIDs(array $responsible_phids) { | ||||
return $this; | return $this; | ||||
} | } | ||||
public function withPackagePHIDs(array $package_phids) { | public function withPackagePHIDs(array $package_phids) { | ||||
$this->packagePHIDs = $package_phids; | $this->packagePHIDs = $package_phids; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function withUnreachable($unreachable) { | |||||
$this->unreachable = $unreachable; | |||||
return $this; | |||||
} | |||||
public function withStatuses(array $statuses) { | public function withStatuses(array $statuses) { | ||||
$this->statuses = $statuses; | $this->statuses = $statuses; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function withEpochRange($min, $max) { | public function withEpochRange($min, $max) { | ||||
$this->epochMin = $min; | $this->epochMin = $min; | ||||
$this->epochMax = $max; | $this->epochMax = $max; | ||||
▲ Show 20 Lines • Show All 357 Lines • ▼ Show 20 Lines | protected function buildWhereClauseParts(AphrontDatabaseConnection $conn) { | ||||
if ($this->packagePHIDs !== null) { | if ($this->packagePHIDs !== null) { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn, | $conn, | ||||
'package.dst IN (%Ls)', | 'package.dst IN (%Ls)', | ||||
$this->packagePHIDs); | $this->packagePHIDs); | ||||
} | } | ||||
if ($this->unreachable !== null) { | |||||
if ($this->unreachable) { | |||||
$where[] = qsprintf( | |||||
$conn, | |||||
'(commit.importStatus & %d) = %d', | |||||
PhabricatorRepositoryCommit::IMPORTED_UNREACHABLE, | |||||
PhabricatorRepositoryCommit::IMPORTED_UNREACHABLE); | |||||
} else { | |||||
$where[] = qsprintf( | |||||
$conn, | |||||
'(commit.importStatus & %d) = 0', | |||||
PhabricatorRepositoryCommit::IMPORTED_UNREACHABLE); | |||||
} | |||||
} | |||||
return $where; | return $where; | ||||
} | } | ||||
protected function didFilterResults(array $filtered) { | protected function didFilterResults(array $filtered) { | ||||
if ($this->identifierMap) { | if ($this->identifierMap) { | ||||
foreach ($this->identifierMap as $name => $commit) { | foreach ($this->identifierMap as $name => $commit) { | ||||
if (isset($filtered[$commit->getPHID()])) { | if (isset($filtered[$commit->getPHID()])) { | ||||
unset($this->identifierMap[$name]); | unset($this->identifierMap[$name]); | ||||
▲ Show 20 Lines • Show All 112 Lines • Show Last 20 Lines |