Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/query/DifferentialRevisionQuery.php
| Show All 19 Lines | final class DifferentialRevisionQuery | ||||
| 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 $repositoryPHIDs; | private $repositoryPHIDs; | ||||
| private $updatedEpochMin; | private $updatedEpochMin; | ||||
| private $updatedEpochMax; | private $updatedEpochMax; | ||||
| private $statuses; | |||||
| 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 105 Lines • ▼ Show 20 Lines | /* -( Query Configuration )------------------------------------------------ */ | ||||
| * @return this | * @return this | ||||
| * @task config | * @task config | ||||
| */ | */ | ||||
| public function withStatus($status_constant) { | public function withStatus($status_constant) { | ||||
| $this->status = $status_constant; | $this->status = $status_constant; | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function withStatuses(array $statuses) { | |||||
| $this->statuses = $statuses; | |||||
| return $this; | |||||
| } | |||||
| /** | /** | ||||
| * Filter results to revisions on given branches. | * Filter results to revisions on given branches. | ||||
| * | * | ||||
| * @param list List of branch names. | * @param list List of branch names. | ||||
| * @return this | * @return this | ||||
| * @task config | * @task config | ||||
| */ | */ | ||||
| ▲ Show 20 Lines • Show All 543 Lines • ▼ Show 20 Lines | protected function buildWhereClause(AphrontDatabaseConnection $conn_r) { | ||||
| $statuses = DifferentialLegacyQuery::getQueryValues($this->status); | $statuses = DifferentialLegacyQuery::getQueryValues($this->status); | ||||
| if ($statuses !== null) { | if ($statuses !== null) { | ||||
| $where[] = qsprintf( | $where[] = qsprintf( | ||||
| $conn_r, | $conn_r, | ||||
| 'r.status IN (%Ls)', | 'r.status IN (%Ls)', | ||||
| $statuses); | $statuses); | ||||
| } | } | ||||
| if ($this->statuses !== null) { | |||||
| $where[] = qsprintf( | |||||
| $conn_r, | |||||
| 'r.status in (%Ls)', | |||||
| DifferentialLegacyQuery::getLegacyValues($this->statuses)); | |||||
| } | |||||
| $where[] = $this->buildWhereClauseParts($conn_r); | $where[] = $this->buildWhereClauseParts($conn_r); | ||||
| return $this->formatWhereClause($where); | return $this->formatWhereClause($where); | ||||
| } | } | ||||
| /** | /** | ||||
| * @task internal | * @task internal | ||||
| */ | */ | ||||
| ▲ Show 20 Lines • Show All 282 Lines • Show Last 20 Lines | |||||