Differential D18419 Diff 44263 src/applications/differential/constants/DifferentialRevisionStatus.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/constants/DifferentialRevisionStatus.php
| Show First 20 Lines • Show All 82 Lines • ▼ Show 20 Lines | public static function newForStatus($status) { | ||||
| if (isset($map[$status])) { | if (isset($map[$status])) { | ||||
| $result->key = $status; | $result->key = $status; | ||||
| $result->spec = $map[$status]; | $result->spec = $map[$status]; | ||||
| } | } | ||||
| return $result; | return $result; | ||||
| } | } | ||||
| public static function newForLegacyStatus($legacy_status) { | |||||
| $result = new self(); | |||||
| $map = self::getMap(); | |||||
| foreach ($map as $key => $spec) { | |||||
| if (!isset($spec['legacy'])) { | |||||
| continue; | |||||
| } | |||||
| if ($spec['legacy'] != $legacy_status) { | |||||
| continue; | |||||
| } | |||||
| $result->key = $key; | |||||
| $result->spec = $spec; | |||||
| break; | |||||
| } | |||||
| return $result; | |||||
| } | |||||
| public static function getAll() { | public static function getAll() { | ||||
| $result = array(); | $result = array(); | ||||
| foreach (self::getMap() as $key => $spec) { | foreach (self::getMap() as $key => $spec) { | ||||
| $result[$key] = self::newForStatus($key); | $result[$key] = self::newForStatus($key); | ||||
| } | } | ||||
| return $result; | return $result; | ||||
| ▲ Show 20 Lines • Show All 71 Lines • Show Last 20 Lines | |||||