Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F1105216
DrydockResourceDestroyWorker.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
948 B
Referenced Files
None
Subscribers
None
DrydockResourceDestroyWorker.php
View Options
<?php
final
class
DrydockResourceDestroyWorker
extends
DrydockWorker
{
protected
function
doWork
()
{
$resource_phid
=
$this
->
getTaskDataValue
(
'resourcePHID'
);
$resource
=
$this
->
loadResource
(
$resource_phid
);
$this
->
destroyResource
(
$resource
);
}
private
function
destroyResource
(
DrydockResource
$resource
)
{
$status
=
$resource
->
getStatus
();
switch
(
$status
)
{
case
DrydockResourceStatus
::
STATUS_CLOSED
:
case
DrydockResourceStatus
::
STATUS_BROKEN
:
break
;
default
:
throw
new
PhabricatorWorkerPermanentFailureException
(
pht
(
'Unable to destroy resource ("%s"), resource has the wrong '
.
'status ("%s").'
,
$resource
->
getPHID
(),
$status
));
}
$blueprint
=
$resource
->
getBlueprint
();
$blueprint
->
destroyResource
(
$resource
);
$resource
->
setStatus
(
DrydockResourceStatus
::
STATUS_DESTROYED
)
->
save
();
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, Jun 30, 7:31 PM (1 d, 20 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
275180
Default Alt Text
DrydockResourceDestroyWorker.php (948 B)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment