Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/phid/DifferentialRevisionPHIDType.php
Show All 27 Lines | public function loadHandles( | ||||
PhabricatorHandleQuery $query, | PhabricatorHandleQuery $query, | ||||
array $handles, | array $handles, | ||||
array $objects) { | array $objects) { | ||||
foreach ($handles as $phid => $handle) { | foreach ($handles as $phid => $handle) { | ||||
$revision = $objects[$phid]; | $revision = $objects[$phid]; | ||||
$title = $revision->getTitle(); | $title = $revision->getTitle(); | ||||
$id = $revision->getID(); | |||||
$status = $revision->getStatus(); | $status = $revision->getStatus(); | ||||
$monogram = $revision->getMonogram(); | |||||
$uri = $revision->getURI(); | |||||
$handle->setName("D{$id}"); | $handle | ||||
$handle->setURI("/D{$id}"); | ->setName($monogram) | ||||
$handle->setFullName("D{$id}: {$title}"); | ->setURI($uri) | ||||
->setFullName("{$monogram}: {$title}"); | |||||
if ($revision->isClosed()) { | if ($revision->isClosed()) { | ||||
$handle->setStatus(PhabricatorObjectHandle::STATUS_CLOSED); | $handle->setStatus(PhabricatorObjectHandle::STATUS_CLOSED); | ||||
} | } | ||||
$status = $revision->getStatus(); | |||||
$icon = DifferentialRevisionStatus::getRevisionStatusIcon($status); | |||||
$color = DifferentialRevisionStatus::getRevisionStatusColor($status); | |||||
$name = ArcanistDifferentialRevisionStatus::getNameForRevisionStatus( | |||||
$status); | |||||
$handle | |||||
->setStateIcon($icon) | |||||
->setStateColor($color) | |||||
->setStateName($name); | |||||
} | } | ||||
} | } | ||||
public function canLoadNamedObject($name) { | public function canLoadNamedObject($name) { | ||||
return preg_match('/^D[1-9]\d*$/i', $name); | return preg_match('/^D[1-9]\d*$/i', $name); | ||||
} | } | ||||
public function loadNamedObjects( | public function loadNamedObjects( | ||||
Show All 25 Lines |