Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/query/DifferentialRevisionQuery.php
| Show First 20 Lines • Show All 765 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); | ||||
| } | } | ||||
| // NOTE: Although the status constants are integers in PHP, the column is a | |||||
| // string column in MySQL, and MySQL won't use keys on string columns if | |||||
| // you put integers in the query. | |||||
| 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 (%Ls)', | ||||
| DifferentialRevisionStatus::getOpenStatuses()); | DifferentialRevisionStatus::getOpenStatuses()); | ||||
| 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 (%Ls)', | ||||
| array( | array( | ||||
| ArcanistDifferentialRevisionStatus::NEEDS_REVIEW, | ArcanistDifferentialRevisionStatus::NEEDS_REVIEW, | ||||
| )); | )); | ||||
| break; | break; | ||||
| case self::STATUS_NEEDS_REVISION: | case self::STATUS_NEEDS_REVISION: | ||||
| $where[] = qsprintf( | $where[] = qsprintf( | ||||
| $conn_r, | $conn_r, | ||||
| 'r.status IN (%Ld)', | 'r.status IN (%Ls)', | ||||
| array( | array( | ||||
| ArcanistDifferentialRevisionStatus::NEEDS_REVISION, | ArcanistDifferentialRevisionStatus::NEEDS_REVISION, | ||||
| )); | )); | ||||
| break; | break; | ||||
| case self::STATUS_ACCEPTED: | case self::STATUS_ACCEPTED: | ||||
| $where[] = qsprintf( | $where[] = qsprintf( | ||||
| $conn_r, | $conn_r, | ||||
| 'r.status IN (%Ld)', | 'r.status IN (%Ls)', | ||||
| array( | array( | ||||
| ArcanistDifferentialRevisionStatus::ACCEPTED, | ArcanistDifferentialRevisionStatus::ACCEPTED, | ||||
| )); | )); | ||||
| break; | break; | ||||
| case self::STATUS_CLOSED: | case self::STATUS_CLOSED: | ||||
| $where[] = qsprintf( | $where[] = qsprintf( | ||||
| $conn_r, | $conn_r, | ||||
| 'r.status IN (%Ld)', | 'r.status IN (%Ls)', | ||||
| DifferentialRevisionStatus::getClosedStatuses()); | DifferentialRevisionStatus::getClosedStatuses()); | ||||
| 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 (%Ls)', | ||||
| array( | array( | ||||
| ArcanistDifferentialRevisionStatus::ABANDONED, | ArcanistDifferentialRevisionStatus::ABANDONED, | ||||
| )); | )); | ||||
| break; | break; | ||||
| default: | default: | ||||
| throw new Exception( | throw new Exception( | ||||
| pht("Unknown revision status filter constant '%s'!", $this->status)); | pht("Unknown revision status filter constant '%s'!", $this->status)); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 328 Lines • Show Last 20 Lines | |||||