Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14379673
D8071.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D8071.diff
View Options
Index: src/applications/people/conduit/ConduitAPI_user_find_Method.php
===================================================================
--- src/applications/people/conduit/ConduitAPI_user_find_Method.php
+++ src/applications/people/conduit/ConduitAPI_user_find_Method.php
@@ -1,19 +1,23 @@
<?php
-/**
- * @group conduit
- */
final class ConduitAPI_user_find_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() {
- return "Find user PHIDs which correspond to provided user aliases. ".
- "Returns NULL for aliases which do have any corresponding PHIDs.";
+ return pht('Lookup PHIDs by username. Obsoleted by "user.query".');
}
public function defineParamTypes() {
return array(
- 'aliases' => 'required nonempty list<string>'
+ 'aliases' => 'required list<string>'
);
}
@@ -27,9 +31,10 @@
}
protected function execute(ConduitAPIRequest $request) {
- $users = id(new PhabricatorUser())->loadAllWhere(
- 'username in (%Ls)',
- $request->getValue('aliases'));
+ $users = id(new PhabricatorPeopleQuery())
+ ->setViewer($request->getUser())
+ ->withUsernames($request->getValue('aliases', array()))
+ ->execute();
return mpull($users, 'getPHID', 'getUsername');
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Dec 22, 3:07 AM (20 h, 41 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6917208
Default Alt Text
D8071.diff (1 KB)
Attached To
Mode
D8071: Deprecate `user.find`
Attached
Detach File
Event Timeline
Log In to Comment