1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-29 02:02:41 +01:00
phorge-phorge/src/applications/people/conduit/UserFindConduitAPIMethod.php

46 lines
1,002 B
PHP
Raw Normal View History

2011-01-24 20:36:53 +01:00
<?php
final class UserFindConduitAPIMethod extends UserConduitAPIMethod {
public function getAPIMethodName() {
return 'user.find';
}
2011-01-24 20:36:53 +01:00
public function getMethodStatus() {
return self::METHOD_STATUS_DEPRECATED;
}
public function getMethodStatusDescription() {
return pht('Obsoleted by "user.query".');
}
2011-01-24 20:36:53 +01:00
public function getMethodDescription() {
return pht('Lookup PHIDs by username. Obsoleted by "user.query".');
2011-01-24 20:36:53 +01:00
}
public function defineParamTypes() {
return array(
'aliases' => 'required list<string>'
2011-01-24 20:36:53 +01:00
);
}
public function defineReturnType() {
return 'nonempty dict<string, phid>';
}
public function defineErrorTypes() {
return array(
);
}
protected function execute(ConduitAPIRequest $request) {
$users = id(new PhabricatorPeopleQuery())
->setViewer($request->getUser())
->withUsernames($request->getValue('aliases', array()))
->execute();
2011-01-24 20:36:53 +01:00
return mpull($users, 'getPHID', 'getUsername');
}
}