Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F482426
PhabricatorPeopleManagementWorkflow.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
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
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Wed, May 7, 1:50 PM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
88943
Default Alt Text
PhabricatorPeopleManagementWorkflow.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment