Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/query/DifferentialRevisionQuery.php
Show All 30 Lines | final class DifferentialRevisionQuery | ||||
private $ccs = array(); | private $ccs = array(); | ||||
private $reviewers = array(); | private $reviewers = array(); | ||||
private $revIDs = array(); | private $revIDs = array(); | ||||
private $commitHashes = array(); | private $commitHashes = array(); | ||||
private $commitPHIDs = array(); | private $commitPHIDs = array(); | ||||
private $phids = array(); | private $phids = array(); | ||||
private $responsibles = array(); | private $responsibles = array(); | ||||
private $branches = array(); | private $branches = array(); | ||||
private $arcanistProjectPHIDs = array(); | |||||
private $repositoryPHIDs; | private $repositoryPHIDs; | ||||
private $updatedEpochMin; | private $updatedEpochMin; | ||||
private $updatedEpochMax; | private $updatedEpochMax; | ||||
const ORDER_MODIFIED = 'order-modified'; | const ORDER_MODIFIED = 'order-modified'; | ||||
const ORDER_CREATED = 'order-created'; | const ORDER_CREATED = 'order-created'; | ||||
private $needRelationships = false; | private $needRelationships = false; | ||||
▲ Show 20 Lines • Show All 175 Lines • ▼ Show 20 Lines | /* -( Query Configuration )------------------------------------------------ */ | ||||
* @task config | * @task config | ||||
*/ | */ | ||||
public function withResponsibleUsers(array $responsible_phids) { | public function withResponsibleUsers(array $responsible_phids) { | ||||
$this->responsibles = $responsible_phids; | $this->responsibles = $responsible_phids; | ||||
return $this; | return $this; | ||||
} | } | ||||
/** | |||||
* Filter results to only return revisions with a given set of arcanist | |||||
* projects. | |||||
* | |||||
* @param array List of project PHIDs. | |||||
* @return this | |||||
* @task config | |||||
*/ | |||||
public function withArcanistProjectPHIDs(array $arc_project_phids) { | |||||
$this->arcanistProjectPHIDs = $arc_project_phids; | |||||
return $this; | |||||
} | |||||
public function withRepositoryPHIDs(array $repository_phids) { | public function withRepositoryPHIDs(array $repository_phids) { | ||||
$this->repositoryPHIDs = $repository_phids; | $this->repositoryPHIDs = $repository_phids; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function withUpdatedEpochBetween($min, $max) { | public function withUpdatedEpochBetween($min, $max) { | ||||
$this->updatedEpochMin = $min; | $this->updatedEpochMin = $min; | ||||
$this->updatedEpochMax = $max; | $this->updatedEpochMax = $max; | ||||
▲ Show 20 Lines • Show All 514 Lines • ▼ Show 20 Lines | protected function buildWhereClause(AphrontDatabaseConnection $conn_r) { | ||||
if ($this->branches) { | if ($this->branches) { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn_r, | $conn_r, | ||||
'r.branchName in (%Ls)', | 'r.branchName in (%Ls)', | ||||
$this->branches); | $this->branches); | ||||
} | } | ||||
if ($this->arcanistProjectPHIDs) { | |||||
$where[] = qsprintf( | |||||
$conn_r, | |||||
'r.arcanistProjectPHID in (%Ls)', | |||||
$this->arcanistProjectPHIDs); | |||||
} | |||||
if ($this->updatedEpochMin !== null) { | if ($this->updatedEpochMin !== null) { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn_r, | $conn_r, | ||||
'r.dateModified >= %d', | 'r.dateModified >= %d', | ||||
$this->updatedEpochMin); | $this->updatedEpochMin); | ||||
} | } | ||||
if ($this->updatedEpochMax !== null) { | if ($this->updatedEpochMax !== null) { | ||||
▲ Show 20 Lines • Show All 385 Lines • Show Last 20 Lines |