Changeset View
Changeset View
Standalone View
Standalone View
src/applications/drydock/storage/DrydockLease.php
| Show All 30 Lines | final class DrydockLease extends DrydockDAO | ||||
| } | } | ||||
| /** | /** | ||||
| * Flag this lease to be released when its destructor is called. This is | * Flag this lease to be released when its destructor is called. This is | ||||
| * mostly useful if you have a script which acquires, uses, and then releases | * mostly useful if you have a script which acquires, uses, and then releases | ||||
| * a lease, as you don't need to explicitly handle exceptions to properly | * a lease, as you don't need to explicitly handle exceptions to properly | ||||
| * release the lease. | * release the lease. | ||||
| */ | */ | ||||
| public function releaseOnDestruction() { | public function setReleaseOnDestruction($release) { | ||||
| $this->releaseOnDestruction = true; | $this->releaseOnDestruction = $release; | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function __destruct() { | public function __destruct() { | ||||
| if (!$this->releaseOnDestruction) { | if (!$this->releaseOnDestruction) { | ||||
| return; | return; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 382 Lines • ▼ Show 20 Lines | public function awakenTasks() { | ||||
| $awaken_ids = $this->getAttribute('internal.awakenTaskIDs'); | $awaken_ids = $this->getAttribute('internal.awakenTaskIDs'); | ||||
| if (is_array($awaken_ids) && $awaken_ids) { | if (is_array($awaken_ids) && $awaken_ids) { | ||||
| PhabricatorWorker::awakenTaskIDs($awaken_ids); | PhabricatorWorker::awakenTaskIDs($awaken_ids); | ||||
| } | } | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function getURI() { | |||||
| $id = $this->getID(); | |||||
| return "/drydock/lease/{$id}/"; | |||||
| } | |||||
| /* -( PhabricatorPolicyInterface )----------------------------------------- */ | /* -( PhabricatorPolicyInterface )----------------------------------------- */ | ||||
| public function getCapabilities() { | public function getCapabilities() { | ||||
| return array( | return array( | ||||
| PhabricatorPolicyCapability::CAN_VIEW, | PhabricatorPolicyCapability::CAN_VIEW, | ||||
| PhabricatorPolicyCapability::CAN_EDIT, | PhabricatorPolicyCapability::CAN_EDIT, | ||||
| Show All 25 Lines | |||||