Changeset View
Changeset View
Standalone View
Standalone View
src/applications/people/conduit/UserQueryConduitAPIMethod.php
<?php | <?php | ||||
final class UserQueryConduitAPIMethod extends UserConduitAPIMethod { | final class UserQueryConduitAPIMethod extends UserConduitAPIMethod { | ||||
public function getAPIMethodName() { | public function getAPIMethodName() { | ||||
return 'user.query'; | return 'user.query'; | ||||
} | } | ||||
public function getMethodDescription() { | public function getMethodDescription() { | ||||
return 'Query users.'; | return 'Query users.'; | ||||
} | } | ||||
public function defineParamTypes() { | protected function defineParamTypes() { | ||||
return array( | return array( | ||||
'usernames' => 'optional list<string>', | 'usernames' => 'optional list<string>', | ||||
'emails' => 'optional list<string>', | 'emails' => 'optional list<string>', | ||||
'realnames' => 'optional list<string>', | 'realnames' => 'optional list<string>', | ||||
'phids' => 'optional list<phid>', | 'phids' => 'optional list<phid>', | ||||
'ids' => 'optional list<uint>', | 'ids' => 'optional list<uint>', | ||||
'offset' => 'optional int', | 'offset' => 'optional int', | ||||
'limit' => 'optional int (default = 100)', | 'limit' => 'optional int (default = 100)', | ||||
); | ); | ||||
} | } | ||||
public function defineReturnType() { | protected function defineReturnType() { | ||||
return 'list<dict>'; | return 'list<dict>'; | ||||
} | } | ||||
public function defineErrorTypes() { | protected function defineErrorTypes() { | ||||
return array( | return array( | ||||
'ERR-INVALID-PARAMETER' => 'Missing or malformed parameter.', | 'ERR-INVALID-PARAMETER' => 'Missing or malformed parameter.', | ||||
); | ); | ||||
} | } | ||||
protected function execute(ConduitAPIRequest $request) { | protected function execute(ConduitAPIRequest $request) { | ||||
$usernames = $request->getValue('usernames', array()); | $usernames = $request->getValue('usernames', array()); | ||||
$emails = $request->getValue('emails', array()); | $emails = $request->getValue('emails', array()); | ||||
▲ Show 20 Lines • Show All 46 Lines • Show Last 20 Lines |