[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/src/applications/people/conduit/ -> UserFindConduitAPIMethod.php (source)

   1  <?php
   2  
   3  final class UserFindConduitAPIMethod extends UserConduitAPIMethod {
   4  
   5    public function getAPIMethodName() {
   6      return 'user.find';
   7    }
   8  
   9    public function getMethodStatus() {
  10      return self::METHOD_STATUS_DEPRECATED;
  11    }
  12  
  13    public function getMethodStatusDescription() {
  14      return pht('Obsoleted by "user.query".');
  15    }
  16  
  17    public function getMethodDescription() {
  18      return pht('Lookup PHIDs by username. Obsoleted by "user.query".');
  19    }
  20  
  21    public function defineParamTypes() {
  22      return array(
  23        'aliases' => 'required list<string>',
  24      );
  25    }
  26  
  27    public function defineReturnType() {
  28      return 'nonempty dict<string, phid>';
  29    }
  30  
  31    public function defineErrorTypes() {
  32      return array(
  33      );
  34    }
  35  
  36    protected function execute(ConduitAPIRequest $request) {
  37      $users = id(new PhabricatorPeopleQuery())
  38        ->setViewer($request->getUser())
  39        ->withUsernames($request->getValue('aliases', array()))
  40        ->execute();
  41  
  42      return mpull($users, 'getPHID', 'getUsername');
  43    }
  44  
  45  }


Generated: Sun Nov 30 09:20:46 2014 Cross-referenced by PHPXref 0.7.1