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 setModernRevisionStatus($status) { | public function setModernRevisionStatus($status) { | ||||
| $status_object = DifferentialRevisionStatus::newForStatus($status); | return $this->setStatus($status); | ||||
| if ($status_object->getKey() != $status) { | |||||
| throw new Exception( | |||||
| pht( | |||||
| 'Trying to set revision to invalid status "%s".', | |||||
| $status)); | |||||
| } | |||||
| $legacy_status = $status_object->getLegacyKey(); | |||||
| return $this->setStatus($legacy_status); | |||||
| } | } | ||||
| public function getModernRevisionStatus() { | public function getModernRevisionStatus() { | ||||
| return $this->getStatusObject()->getKey(); | return $this->getStatus(); | ||||
| } | } | ||||
| public function getLegacyRevisionStatus() { | public function getLegacyRevisionStatus() { | ||||
| return $this->getStatus(); | return $this->getStatusObject()->getLegacyKey(); | ||||
| } | } | ||||
| public function isClosed() { | public function isClosed() { | ||||
| return $this->getStatusObject()->isClosedStatus(); | return $this->getStatusObject()->isClosedStatus(); | ||||
| } | } | ||||
| public function isAbandoned() { | public function isAbandoned() { | ||||
| return $this->getStatusObject()->isAbandoned(); | return $this->getStatusObject()->isAbandoned(); | ||||
| Show All 28 Lines | /* -( PhabricatorTokenReceiverInterface )---------------------------------- */ | ||||
| } | } | ||||
| public function getStatusIconColor() { | public function getStatusIconColor() { | ||||
| return $this->getStatusObject()->getIconColor(); | return $this->getStatusObject()->getIconColor(); | ||||
| } | } | ||||
| public function getStatusObject() { | public function getStatusObject() { | ||||
| $status = $this->getStatus(); | $status = $this->getStatus(); | ||||
| return DifferentialRevisionStatus::newForLegacyStatus($status); | return DifferentialRevisionStatus::newForStatus($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 277 Lines • Show Last 20 Lines | |||||