Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F112237594
DrydockWorker.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, May 9, 05:24
Size
1 KB
Mime Type
text/x-php
Expires
Sun, May 11, 05:24 (2 d)
Engine
blob
Format
Raw Data
Handle
26052657
Attached To
rPH Phabricator
DrydockWorker.php
View Options
<?php
abstract
class
DrydockWorker
extends
PhabricatorWorker
{
protected
function
getViewer
()
{
return
PhabricatorUser
::
getOmnipotentUser
();
}
protected
function
loadLease
(
$lease_phid
)
{
$viewer
=
$this
->
getViewer
();
$lease
=
id
(
new
DrydockLeaseQuery
())
->
setViewer
(
$viewer
)
->
withPHIDs
(
array
(
$lease_phid
))
->
executeOne
();
if
(!
$lease
)
{
throw
new
PhabricatorWorkerPermanentFailureException
(
pht
(
'No such lease "%s"!'
,
$lease_phid
));
}
return
$lease
;
}
protected
function
loadResource
(
$resource_phid
)
{
$viewer
=
$this
->
getViewer
();
$resource
=
id
(
new
DrydockResourceQuery
())
->
setViewer
(
$viewer
)
->
withPHIDs
(
array
(
$resource_phid
))
->
executeOne
();
if
(!
$resource
)
{
throw
new
PhabricatorWorkerPermanentFailureException
(
pht
(
'No such resource "%s"!'
,
$resource_phid
));
}
return
$resource
;
}
protected
function
loadCommands
(
$target_phid
)
{
$viewer
=
$this
->
getViewer
();
$commands
=
id
(
new
DrydockCommandQuery
())
->
setViewer
(
$viewer
)
->
withTargetPHIDs
(
array
(
$target_phid
))
->
withConsumed
(
false
)
->
execute
();
$commands
=
msort
(
$commands
,
'getID'
);
return
$commands
;
}
}
Event Timeline
Log In to Comment