Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F96988773
AlmanacManagementWorkflow.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
Wed, Jan 1, 09:28
Size
1 KB
Mime Type
text/x-php
Expires
Fri, Jan 3, 09:28 (2 d)
Engine
blob
Format
Raw Data
Handle
23307620
Attached To
rPH Phabricator
AlmanacManagementWorkflow.php
View Options
<?php
abstract
class
AlmanacManagementWorkflow
extends
PhabricatorManagementWorkflow
{
protected
function
loadServices
(
array
$names
)
{
if
(!
$names
)
{
return
array
();
}
$services
=
id
(
new
AlmanacServiceQuery
())
->
setViewer
(
$this
->
getViewer
())
->
withNames
(
$names
)
->
execute
();
$services
=
mpull
(
$services
,
null
,
'getName'
);
foreach
(
$names
as
$name
)
{
if
(
empty
(
$services
[
$name
]))
{
throw
new
PhutilArgumentUsageException
(
pht
(
'Service "%s" does not exist or could not be loaded!'
,
$name
));
}
}
return
$services
;
}
protected
function
updateServiceLock
(
AlmanacService
$service
,
$lock
)
{
$almanac_phid
=
id
(
new
PhabricatorAlmanacApplication
())->
getPHID
();
$xaction
=
id
(
new
AlmanacServiceTransaction
())
->
setTransactionType
(
AlmanacServiceTransaction
::
TYPE_LOCK
)
->
setNewValue
((
int
)
$lock
);
$editor
=
id
(
new
AlmanacServiceEditor
())
->
setActor
(
$this
->
getViewer
())
->
setActingAsPHID
(
$almanac_phid
)
->
setContentSource
(
PhabricatorContentSource
::
newConsoleSource
())
->
setContinueOnMissingFields
(
true
);
$editor
->
applyTransactions
(
$service
,
array
(
$xaction
));
}
}
Event Timeline
Log In to Comment