Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2894376
PhabricatorPeopleManagementWorkflow.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
PhabricatorPeopleManagementWorkflow.php
View Options
<?php
abstract
class
PhabricatorPeopleManagementWorkflow
extends
PhabricatorManagementWorkflow
{
final
protected
function
getUserSelectionArguments
(
)
{
return
array
(
array
(
'name'
=>
'user'
,
'param'
=>
'username'
,
'help'
=>
pht
(
'User account to act on.'
)
,
)
,
)
;
}
final
protected
function
selectUser
(
PhutilArgumentParser
$argv
)
{
$username
=
$argv
->
getArg
(
'user'
)
;
if
(
!
strlen
(
$username
)
)
{
throw
new
PhutilArgumentUsageException
(
pht
(
'Select a user account to act on with "--user <username>".'
)
)
;
}
$user
=
id
(
new
PhabricatorPeopleQuery
(
)
)
->
setViewer
(
$this
->
getViewer
(
)
)
->
withUsernames
(
array
(
$username
)
)
->
executeOne
(
)
;
if
(
!
$user
)
{
throw
new
PhutilArgumentUsageException
(
pht
(
'No user with username "%s" exists.'
,
$username
)
)
;
}
return
$user
;
}
final
protected
function
applyTransactions
(
PhabricatorUser
$user
,
array
$xactions
)
{
assert_instances_of
(
$xactions
,
'PhabricatorUserTransaction'
)
;
$viewer
=
$this
->
getViewer
(
)
;
$application
=
id
(
new
PhabricatorPeopleApplication
(
)
)
->
getPHID
(
)
;
$content_source
=
$this
->
newContentSource
(
)
;
$editor
=
$user
->
getApplicationTransactionEditor
(
)
->
setActor
(
$viewer
)
->
setActingAsPHID
(
$application
)
->
setContentSource
(
$content_source
)
->
setContinueOnMissingFields
(
true
)
;
return
$editor
->
applyTransactions
(
$user
,
$xactions
)
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Jan 19, 19:48 (1 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1109705
Default Alt Text
PhabricatorPeopleManagementWorkflow.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment