[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/src/applications/phid/conduit/ -> PHIDQueryConduitAPIMethod.php (source)

   1  <?php
   2  
   3  final class PHIDQueryConduitAPIMethod extends PHIDConduitAPIMethod {
   4  
   5    public function getAPIMethodName() {
   6      return 'phid.query';
   7    }
   8  
   9    public function getMethodDescription() {
  10      return 'Retrieve information about arbitrary PHIDs.';
  11    }
  12  
  13    public function defineParamTypes() {
  14      return array(
  15        'phids' => 'required list<phid>',
  16      );
  17    }
  18  
  19    public function defineReturnType() {
  20      return 'nonempty dict<string, wild>';
  21    }
  22  
  23    public function defineErrorTypes() {
  24      return array();
  25    }
  26  
  27    protected function execute(ConduitAPIRequest $request) {
  28      $phids = $request->getValue('phids');
  29  
  30      $handles = id(new PhabricatorHandleQuery())
  31        ->setViewer($request->getUser())
  32        ->withPHIDs($phids)
  33        ->execute();
  34  
  35      $result = array();
  36      foreach ($handles as $phid => $handle) {
  37        if ($handle->isComplete()) {
  38          $result[$phid] = $this->buildHandleInformationDictionary($handle);
  39        }
  40      }
  41  
  42      return $result;
  43    }
  44  
  45  }


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