Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/storage/DifferentialRevision.php
| Show First 20 Lines • Show All 607 Lines • ▼ Show 20 Lines | /* -( PhabricatorTokenReceiverInterface )---------------------------------- */ | ||||
| } | } | ||||
| public function attachRepository(PhabricatorRepository $repository = null) { | public function attachRepository(PhabricatorRepository $repository = null) { | ||||
| $this->repository = $repository; | $this->repository = $repository; | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function isClosed() { | public function isClosed() { | ||||
| return DifferentialRevisionStatus::isClosedStatus($this->getStatus()); | return $this->getStatusObject()->isClosedStatus(); | ||||
| } | } | ||||
| public function isAbandoned() { | public function isAbandoned() { | ||||
| $status_abandoned = ArcanistDifferentialRevisionStatus::ABANDONED; | return $this->getStatusObject()->isAbandoned(); | ||||
| return ($this->getStatus() == $status_abandoned); | |||||
| } | } | ||||
| public function isAccepted() { | public function isAccepted() { | ||||
| $status_accepted = ArcanistDifferentialRevisionStatus::ACCEPTED; | return $this->getStatusObject()->isAccepted(); | ||||
| return ($this->getStatus() == $status_accepted); | |||||
| } | } | ||||
| public function isNeedsReview() { | public function isNeedsReview() { | ||||
| $status_review = ArcanistDifferentialRevisionStatus::NEEDS_REVIEW; | return $this->getStatusObject()->isNeedsReview(); | ||||
| return ($this->getStatus() == $status_review); | |||||
| } | } | ||||
| public function getStatusIcon() { | public function getStatusIcon() { | ||||
| $map = array( | return $this->getStatusObject()->getIcon(); | ||||
| ArcanistDifferentialRevisionStatus::NEEDS_REVIEW | |||||
| => 'fa-code grey', | |||||
| ArcanistDifferentialRevisionStatus::NEEDS_REVISION | |||||
| => 'fa-refresh red', | |||||
| ArcanistDifferentialRevisionStatus::CHANGES_PLANNED | |||||
| => 'fa-headphones red', | |||||
| ArcanistDifferentialRevisionStatus::ACCEPTED | |||||
| => 'fa-check green', | |||||
| ArcanistDifferentialRevisionStatus::CLOSED | |||||
| => 'fa-check-square-o black', | |||||
| ArcanistDifferentialRevisionStatus::ABANDONED | |||||
| => 'fa-plane black', | |||||
| ); | |||||
| return idx($map, $this->getStatus()); | |||||
| } | } | ||||
| public function getStatusDisplayName() { | public function getStatusDisplayName() { | ||||
| return $this->getStatusObject()->getDisplayName(); | |||||
| } | |||||
| public function getStatusIconColor() { | |||||
| return $this->getStatusObject()->getIconColor(); | |||||
| } | |||||
| public function getStatusObject() { | |||||
| $status = $this->getStatus(); | $status = $this->getStatus(); | ||||
| return ArcanistDifferentialRevisionStatus::getNameForRevisionStatus( | return DifferentialRevisionStatus::newForLegacyStatus($status); | ||||
| $status); | |||||
| } | } | ||||
| public function getFlag(PhabricatorUser $viewer) { | public function getFlag(PhabricatorUser $viewer) { | ||||
| return $this->assertAttachedKey($this->flags, $viewer->getPHID()); | return $this->assertAttachedKey($this->flags, $viewer->getPHID()); | ||||
| } | } | ||||
| public function attachFlag( | public function attachFlag( | ||||
| PhabricatorUser $viewer, | PhabricatorUser $viewer, | ||||
| ▲ Show 20 Lines • Show All 264 Lines • Show Last 20 Lines | |||||