Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/constants/DifferentialLegacyQuery.php
| Show All 9 Lines | final class DifferentialLegacyQuery | ||||
| const STATUS_NEEDS_REVISION = 'status-needs-revision'; | const STATUS_NEEDS_REVISION = 'status-needs-revision'; | ||||
| const STATUS_CLOSED = 'status-closed'; | const STATUS_CLOSED = 'status-closed'; | ||||
| const STATUS_ABANDONED = 'status-abandoned'; | const STATUS_ABANDONED = 'status-abandoned'; | ||||
| public static function getAllConstants() { | public static function getAllConstants() { | ||||
| return array_keys(self::getMap()); | return array_keys(self::getMap()); | ||||
| } | } | ||||
| public static function getQueryValues($status) { | public static function getModernValues($status) { | ||||
| if ($status === self::STATUS_ANY) { | if ($status === self::STATUS_ANY) { | ||||
| return null; | return null; | ||||
| } | } | ||||
| $map = self::getMap(); | $map = self::getMap(); | ||||
| if (!isset($map[$status])) { | if (!isset($map[$status])) { | ||||
| throw new Exception( | throw new Exception( | ||||
| pht( | pht( | ||||
| 'Unknown revision status filter constant "%s".', | 'Unknown revision status filter constant "%s".', | ||||
| $status)); | $status)); | ||||
| } | } | ||||
| return self::getLegacyValues($map[$status]); | return $map[$status]; | ||||
| } | } | ||||
| public static function getLegacyValues(array $modern_values) { | public static function getLegacyValues(array $modern_values) { | ||||
| $values = array(); | $values = array(); | ||||
| foreach ($modern_values as $status_constant) { | foreach ($modern_values as $status_constant) { | ||||
| $status_object = DifferentialRevisionStatus::newForStatus( | $status_object = DifferentialRevisionStatus::newForStatus( | ||||
| $status_constant); | $status_constant); | ||||
| ▲ Show 20 Lines • Show All 51 Lines • Show Last 20 Lines | |||||