Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/query/DifferentialRevisionQuery.php
| Show All 20 Lines | final class DifferentialRevisionQuery | ||||
| 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; | private $statuses; | ||||
| private $isOpen; | |||||
| 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 110 Lines • ▼ Show 20 Lines | public function withStatus($status_constant) { | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function withStatuses(array $statuses) { | public function withStatuses(array $statuses) { | ||||
| $this->statuses = $statuses; | $this->statuses = $statuses; | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function withIsOpen($is_open) { | |||||
| $this->isOpen = $is_open; | |||||
| 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 550 Lines • ▼ Show 20 Lines | protected function buildWhereClause(AphrontDatabaseConnection $conn_r) { | ||||
| if ($this->statuses !== null) { | if ($this->statuses !== null) { | ||||
| $where[] = qsprintf( | $where[] = qsprintf( | ||||
| $conn_r, | $conn_r, | ||||
| 'r.status in (%Ls)', | 'r.status in (%Ls)', | ||||
| DifferentialLegacyQuery::getLegacyValues($this->statuses)); | DifferentialLegacyQuery::getLegacyValues($this->statuses)); | ||||
| } | } | ||||
| if ($this->isOpen !== null) { | |||||
| if ($this->isOpen) { | |||||
| $statuses = DifferentialLegacyQuery::getQueryValues( | |||||
| DifferentialLegacyQuery::STATUS_OPEN); | |||||
| } else { | |||||
| $statuses = DifferentialLegacyQuery::getQueryValues( | |||||
| DifferentialLegacyQuery::STATUS_CLOSED); | |||||
| } | |||||
| $where[] = qsprintf( | |||||
| $conn_r, | |||||
| 'r.status in (%Ls)', | |||||
| $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 | |||||