Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/query/DifferentialRevisionQuery.php
Show All 19 Lines | final class DifferentialRevisionQuery | ||||
private $phids = array(); | private $phids = array(); | ||||
private $responsibles = array(); | private $responsibles = array(); | ||||
private $branches = array(); | private $branches = array(); | ||||
private $repositoryPHIDs; | private $repositoryPHIDs; | ||||
private $updatedEpochMin; | private $updatedEpochMin; | ||||
private $updatedEpochMax; | private $updatedEpochMax; | ||||
private $statuses; | private $statuses; | ||||
private $isOpen; | private $isOpen; | ||||
private $createdEpochMin; | |||||
private $createdEpochMax; | |||||
const ORDER_MODIFIED = 'order-modified'; | const ORDER_MODIFIED = 'order-modified'; | ||||
const ORDER_CREATED = 'order-created'; | const ORDER_CREATED = 'order-created'; | ||||
private $needActiveDiffs = false; | private $needActiveDiffs = false; | ||||
private $needDiffIDs = false; | private $needDiffIDs = false; | ||||
private $needCommitPHIDs = false; | private $needCommitPHIDs = false; | ||||
private $needHashes = false; | private $needHashes = false; | ||||
▲ Show 20 Lines • Show All 165 Lines • ▼ Show 20 Lines | /* -( Query Configuration )------------------------------------------------ */ | ||||
} | } | ||||
public function withUpdatedEpochBetween($min, $max) { | public function withUpdatedEpochBetween($min, $max) { | ||||
$this->updatedEpochMin = $min; | $this->updatedEpochMin = $min; | ||||
$this->updatedEpochMax = $max; | $this->updatedEpochMax = $max; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function withCreatedEpochBetween($min, $max) { | |||||
$this->createdEpochMin = $min; | |||||
$this->createdEpochMax = $max; | |||||
return $this; | |||||
} | |||||
/** | /** | ||||
* Set whether or not the query should load the active diff for each | * Set whether or not the query should load the active diff for each | ||||
* revision. | * revision. | ||||
* | * | ||||
* @param bool True to load and attach diffs. | * @param bool True to load and attach diffs. | ||||
* @return this | * @return this | ||||
* @task config | * @task config | ||||
▲ Show 20 Lines • Show All 465 Lines • ▼ Show 20 Lines | protected function buildWhereClause(AphrontDatabaseConnection $conn_r) { | ||||
if ($this->updatedEpochMax !== null) { | if ($this->updatedEpochMax !== null) { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn_r, | $conn_r, | ||||
'r.dateModified <= %d', | 'r.dateModified <= %d', | ||||
$this->updatedEpochMax); | $this->updatedEpochMax); | ||||
} | } | ||||
if ($this->createdEpochMin !== null) { | |||||
$where[] = qsprintf( | |||||
$conn_r, | |||||
'r.dateCreated >= %d', | |||||
$this->createdEpochMin); | |||||
} | |||||
if ($this->createdEpochMax !== null) { | |||||
$where[] = qsprintf( | |||||
$conn_r, | |||||
'r.dateCreated <= %d', | |||||
$this->createdEpochMax); | |||||
} | |||||
if ($this->statuses !== null) { | if ($this->statuses !== null) { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn_r, | $conn_r, | ||||
'r.status in (%Ls)', | 'r.status in (%Ls)', | ||||
$this->statuses); | $this->statuses); | ||||
} | } | ||||
if ($this->isOpen !== null) { | if ($this->isOpen !== null) { | ||||
▲ Show 20 Lines • Show All 295 Lines • Show Last 20 Lines |