Path: blob/master/src/applications/people/conduit/UserFindConduitAPIMethod.php
12256 views
<?php12final class UserFindConduitAPIMethod extends UserConduitAPIMethod {34public function getAPIMethodName() {5return 'user.find';6}78public function getMethodStatus() {9return self::METHOD_STATUS_DEPRECATED;10}1112public function getMethodStatusDescription() {13return pht('Obsoleted by "%s".', 'user.query');14}1516public function getMethodDescription() {17return pht('Lookup PHIDs by username. Obsoleted by "%s".', 'user.query');18}1920protected function defineParamTypes() {21return array(22'aliases' => 'required list<string>',23);24}2526protected function defineReturnType() {27return 'nonempty dict<string, phid>';28}2930protected function execute(ConduitAPIRequest $request) {31$users = id(new PhabricatorPeopleQuery())32->setViewer($request->getUser())33->withUsernames($request->getValue('aliases', array()))34->execute();3536return mpull($users, 'getPHID', 'getUsername');37}3839}404142