Changeset View
Changeset View
Standalone View
Standalone View
src/applications/drydock/storage/DrydockLease.php
Show First 20 Lines • Show All 386 Lines • ▼ Show 20 Lines | PhabricatorWorker::scheduleTask( | ||||
'isExpireTask' => ($epoch !== null), | 'isExpireTask' => ($epoch !== null), | ||||
), | ), | ||||
array( | array( | ||||
'objectPHID' => $this->getPHID(), | 'objectPHID' => $this->getPHID(), | ||||
'delayUntil' => ($epoch ? (int)$epoch : null), | 'delayUntil' => ($epoch ? (int)$epoch : null), | ||||
)); | )); | ||||
} | } | ||||
public function getAllocatedResourcePHIDs() { | |||||
return $this->getAttribute('internal.resourcePHIDs.allocated', array()); | |||||
} | |||||
public function setAllocatedResourcePHIDs(array $phids) { | |||||
return $this->setAttribute('internal.resourcePHIDs.allocated', $phids); | |||||
} | |||||
public function addAllocatedResourcePHIDs(array $phids) { | |||||
$allocated_phids = $this->getAllocatedResourcePHIDs(); | |||||
foreach ($phids as $phid) { | |||||
$allocated_phids[$phid] = $phid; | |||||
} | |||||
return $this->setAllocatedResourcePHIDs($allocated_phids); | |||||
} | |||||
public function removeAllocatedResourcePHIDs(array $phids) { | |||||
$allocated_phids = $this->getAllocatedResourcePHIDs(); | |||||
foreach ($phids as $phid) { | |||||
unset($allocated_phids[$phid]); | |||||
} | |||||
return $this->setAllocatedResourcePHIDs($allocated_phids); | |||||
} | |||||
public function getReclaimedResourcePHIDs() { | |||||
return $this->getAttribute('internal.resourcePHIDs.reclaimed', array()); | |||||
} | |||||
public function setReclaimedResourcePHIDs(array $phids) { | |||||
return $this->setAttribute('internal.resourcePHIDs.reclaimed', $phids); | |||||
} | |||||
public function addReclaimedResourcePHIDs(array $phids) { | |||||
$reclaimed_phids = $this->getReclaimedResourcePHIDs(); | |||||
foreach ($phids as $phid) { | |||||
$reclaimed_phids[$phid] = $phid; | |||||
} | |||||
return $this->setReclaimedResourcePHIDs($reclaimed_phids); | |||||
} | |||||
public function removeReclaimedResourcePHIDs(array $phids) { | |||||
$reclaimed_phids = $this->getReclaimedResourcePHIDs(); | |||||
foreach ($phids as $phid) { | |||||
unset($reclaimed_phids[$phid]); | |||||
} | |||||
return $this->setReclaimedResourcePHIDs($reclaimed_phids); | |||||
} | |||||
public function setAwakenTaskIDs(array $ids) { | public function setAwakenTaskIDs(array $ids) { | ||||
$this->setAttribute('internal.awakenTaskIDs', $ids); | $this->setAttribute('internal.awakenTaskIDs', $ids); | ||||
return $this; | return $this; | ||||
} | } | ||||
public function setAllowedBlueprintPHIDs(array $phids) { | public function setAllowedBlueprintPHIDs(array $phids) { | ||||
$this->setAttribute('internal.blueprintPHIDs', $phids); | $this->setAttribute('internal.blueprintPHIDs', $phids); | ||||
return $this; | return $this; | ||||
▲ Show 20 Lines • Show All 210 Lines • Show Last 20 Lines |