Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2889490
DrydockManagementUpdateLeaseWorkflow.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
1 KB
Referenced Files
None
Subscribers
None
DrydockManagementUpdateLeaseWorkflow.php
View Options
<?php
final
class
DrydockManagementUpdateLeaseWorkflow
extends
DrydockManagementWorkflow
{
protected
function
didConstruct
(
)
{
$this
->
setName
(
'update-lease'
)
->
setSynopsis
(
pht
(
'Update a lease.'
)
)
->
setArguments
(
array
(
array
(
'name'
=>
'id'
,
'param'
=>
'id'
,
'repeat'
=>
true
,
'help'
=>
pht
(
'Lease ID to update.'
)
,
)
,
)
)
;
}
public
function
execute
(
PhutilArgumentParser
$args
)
{
$viewer
=
$this
->
getViewer
(
)
;
$ids
=
$args
->
getArg
(
'id'
)
;
if
(
!
$ids
)
{
throw
new
PhutilArgumentUsageException
(
pht
(
'Specify one or more lease IDs to update with "%s".'
,
'--id'
)
)
;
}
$leases
=
id
(
new
DrydockLeaseQuery
(
)
)
->
setViewer
(
$viewer
)
->
withIDs
(
$ids
)
->
execute
(
)
;
PhabricatorWorker
::
setRunAllTasksInProcess
(
true
)
;
foreach
(
$ids
as
$id
)
{
$lease
=
idx
(
$leases
,
$id
)
;
if
(
!
$lease
)
{
echo
tsprintf
(
"%s\n"
,
pht
(
'Lease "%s" does not exist.'
,
$id
)
)
;
continue
;
}
echo
tsprintf
(
"%s\n"
,
pht
(
'Updating lease "%s".'
,
$id
)
)
;
$lease
->
scheduleUpdate
(
)
;
}
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Jan 19 2025, 12:14 (4 w, 2 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1124446
Default Alt Text
DrydockManagementUpdateLeaseWorkflow.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment