Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F104816589
PhabricatorPeopleManagementWorkflow.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, Mar 12, 15:31
Size
1 KB
Mime Type
text/x-php
Expires
Fri, Mar 14, 15:31 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
24859668
Attached To
rPH Phabricator
PhabricatorPeopleManagementWorkflow.php
View Options
<?php
abstract
class
PhabricatorPeopleManagementWorkflow
extends
PhabricatorManagementWorkflow
{
protected
function
buildIterator
(
PhutilArgumentParser
$args
)
{
$usernames
=
$args
->
getArg
(
'users'
);
if
(
$args
->
getArg
(
'all'
))
{
if
(
$usernames
)
{
throw
new
PhutilArgumentUsageException
(
pht
(
'Specify either a list of users or `%s`, but not both.'
,
'--all'
));
}
return
new
LiskMigrationIterator
(
new
PhabricatorUser
());
}
if
(
$usernames
)
{
return
$this
->
loadUsersWithUsernames
(
$usernames
);
}
return
null
;
}
protected
function
loadUsersWithUsernames
(
array
$usernames
)
{
$users
=
array
();
foreach
(
$usernames
as
$username
)
{
$query
=
id
(
new
PhabricatorPeopleQuery
())
->
setViewer
(
$this
->
getViewer
())
->
withUsernames
(
array
(
$username
))
->
executeOne
();
if
(!
$query
)
{
throw
new
PhutilArgumentUsageException
(
pht
(
'"%s" is not a valid username.'
,
$username
));
}
$users
[]
=
$query
;
}
return
$users
;
}
}
Event Timeline
Log In to Comment