Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/query/DifferentialRevisionQuery.php
Show All 17 Lines | final class DifferentialRevisionQuery | ||||
private $pathIDs = array(); | private $pathIDs = array(); | ||||
private $status = 'status-any'; | private $status = 'status-any'; | ||||
const STATUS_ANY = 'status-any'; | const STATUS_ANY = 'status-any'; | ||||
const STATUS_OPEN = 'status-open'; | const STATUS_OPEN = 'status-open'; | ||||
const STATUS_ACCEPTED = 'status-accepted'; | const STATUS_ACCEPTED = 'status-accepted'; | ||||
const STATUS_NEEDS_REVIEW = 'status-needs-review'; | const STATUS_NEEDS_REVIEW = 'status-needs-review'; | ||||
const STATUS_NEEDS_REVISION = 'status-needs-revision'; | const STATUS_NEEDS_REVISION = 'status-needs-revision'; | ||||
const STATUS_CLOSED = 'status-closed'; // NOTE: Same as 'committed' | const STATUS_CLOSED = 'status-closed'; | ||||
const STATUS_COMMITTED = 'status-committed'; // TODO: Remove. | |||||
const STATUS_ABANDONED = 'status-abandoned'; | const STATUS_ABANDONED = 'status-abandoned'; | ||||
private $authors = array(); | private $authors = array(); | ||||
private $draftAuthors = array(); | private $draftAuthors = array(); | ||||
private $ccs = array(); | private $ccs = array(); | ||||
private $reviewers = array(); | private $reviewers = array(); | ||||
private $revIDs = array(); | private $revIDs = array(); | ||||
private $commitHashes = array(); | private $commitHashes = array(); | ||||
▲ Show 20 Lines • Show All 731 Lines • ▼ Show 20 Lines | private function buildWhereClause($conn_r) { | ||||
switch ($this->status) { | switch ($this->status) { | ||||
case self::STATUS_ANY: | case self::STATUS_ANY: | ||||
break; | break; | ||||
case self::STATUS_OPEN: | case self::STATUS_OPEN: | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn_r, | $conn_r, | ||||
'r.status IN (%Ld)', | 'r.status IN (%Ld)', | ||||
array( | DifferentialRevisionStatus::getOpenStatuses()); | ||||
ArcanistDifferentialRevisionStatus::NEEDS_REVIEW, | |||||
ArcanistDifferentialRevisionStatus::NEEDS_REVISION, | |||||
ArcanistDifferentialRevisionStatus::ACCEPTED, | |||||
)); | |||||
break; | break; | ||||
case self::STATUS_NEEDS_REVIEW: | case self::STATUS_NEEDS_REVIEW: | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn_r, | $conn_r, | ||||
'r.status IN (%Ld)', | 'r.status IN (%Ld)', | ||||
array( | array( | ||||
ArcanistDifferentialRevisionStatus::NEEDS_REVIEW, | ArcanistDifferentialRevisionStatus::NEEDS_REVIEW, | ||||
)); | )); | ||||
Show All 9 Lines | switch ($this->status) { | ||||
case self::STATUS_ACCEPTED: | case self::STATUS_ACCEPTED: | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn_r, | $conn_r, | ||||
'r.status IN (%Ld)', | 'r.status IN (%Ld)', | ||||
array( | array( | ||||
ArcanistDifferentialRevisionStatus::ACCEPTED, | ArcanistDifferentialRevisionStatus::ACCEPTED, | ||||
)); | )); | ||||
break; | break; | ||||
case self::STATUS_COMMITTED: | |||||
phlog( | |||||
"WARNING: DifferentialRevisionQuery using deprecated ". | |||||
"STATUS_COMMITTED constant. This will be removed soon. ". | |||||
"Use STATUS_CLOSED."); | |||||
// fallthrough | |||||
case self::STATUS_CLOSED: | case self::STATUS_CLOSED: | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn_r, | $conn_r, | ||||
'r.status IN (%Ld)', | 'r.status IN (%Ld)', | ||||
array( | DifferentialRevisionStatus::getClosedStatuses()); | ||||
ArcanistDifferentialRevisionStatus::CLOSED, | |||||
)); | |||||
break; | break; | ||||
case self::STATUS_ABANDONED: | case self::STATUS_ABANDONED: | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn_r, | $conn_r, | ||||
'r.status IN (%Ld)', | 'r.status IN (%Ld)', | ||||
array( | array( | ||||
ArcanistDifferentialRevisionStatus::ABANDONED, | ArcanistDifferentialRevisionStatus::ABANDONED, | ||||
)); | )); | ||||
▲ Show 20 Lines • Show All 378 Lines • Show Last 20 Lines |