From e26fbbf973d6de9a116b7a0c80b2abab1104fa5b Mon Sep 17 00:00:00 2001 From: epriestley Date: Sat, 25 Jan 2014 14:23:39 -0800 Subject: [PATCH] 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 --- .../conduit/ConduitAPI_user_find_Method.php | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/applications/people/conduit/ConduitAPI_user_find_Method.php b/src/applications/people/conduit/ConduitAPI_user_find_Method.php index ab2dadf102..b5e1b06966 100644 --- a/src/applications/people/conduit/ConduitAPI_user_find_Method.php +++ b/src/applications/people/conduit/ConduitAPI_user_find_Method.php @@ -1,19 +1,23 @@ 'required nonempty list' + 'aliases' => 'required list' ); } @@ -27,9 +31,10 @@ final class ConduitAPI_user_find_Method } 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'); }