mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-30 01:10:58 +01:00
Deprecate user.find
Summary: Super old method which is completely obsoleted by `user.query` Test Plan: Poked around web UI, ran method. Reviewers: btrahan Reviewed By: btrahan CC: aran Differential Revision: https://secure.phabricator.com/D8071
This commit is contained in:
parent
e34a44a7ed
commit
e26fbbf973
1 changed files with 14 additions and 9 deletions
|
@ -1,19 +1,23 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
|
||||||
* @group conduit
|
|
||||||
*/
|
|
||||||
final class ConduitAPI_user_find_Method
|
final class ConduitAPI_user_find_Method
|
||||||
extends ConduitAPI_user_Method {
|
extends ConduitAPI_user_Method {
|
||||||
|
|
||||||
|
public function getMethodStatus() {
|
||||||
|
return self::METHOD_STATUS_DEPRECATED;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getMethodStatusDescription() {
|
||||||
|
return pht('Obsoleted by "user.query".');
|
||||||
|
}
|
||||||
|
|
||||||
public function getMethodDescription() {
|
public function getMethodDescription() {
|
||||||
return "Find user PHIDs which correspond to provided user aliases. ".
|
return pht('Lookup PHIDs by username. Obsoleted by "user.query".');
|
||||||
"Returns NULL for aliases which do have any corresponding PHIDs.";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function defineParamTypes() {
|
public function defineParamTypes() {
|
||||||
return array(
|
return array(
|
||||||
'aliases' => 'required nonempty list<string>'
|
'aliases' => 'required list<string>'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,9 +31,10 @@ final class ConduitAPI_user_find_Method
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function execute(ConduitAPIRequest $request) {
|
protected function execute(ConduitAPIRequest $request) {
|
||||||
$users = id(new PhabricatorUser())->loadAllWhere(
|
$users = id(new PhabricatorPeopleQuery())
|
||||||
'username in (%Ls)',
|
->setViewer($request->getUser())
|
||||||
$request->getValue('aliases'));
|
->withUsernames($request->getValue('aliases', array()))
|
||||||
|
->execute();
|
||||||
|
|
||||||
return mpull($users, 'getPHID', 'getUsername');
|
return mpull($users, 'getPHID', 'getUsername');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue