Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F88703145
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
Sun, Oct 20, 06:25
Size
1 KB
Mime Type
text/x-php
Expires
Tue, Oct 22, 06:25 (2 d)
Engine
blob
Format
Raw Data
Handle
21809358
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
(
$this
->
newContentSource
())
->
setContinueOnMissingFields
(
true
);
$editor
->
applyTransactions
(
$service
,
array
(
$xaction
));
}
}
Event Timeline
Log In to Comment