[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/src/applications/maniphest/conduit/ -> ManiphestInfoConduitAPIMethod.php (source)

   1  <?php
   2  
   3  final class ManiphestInfoConduitAPIMethod extends ManiphestConduitAPIMethod {
   4  
   5    public function getAPIMethodName() {
   6      return 'maniphest.info';
   7    }
   8  
   9    public function getMethodDescription() {
  10      return 'Retrieve information about a Maniphest task, given its id.';
  11    }
  12  
  13    public function defineParamTypes() {
  14      return array(
  15        'task_id' => 'required id',
  16      );
  17    }
  18  
  19    public function defineReturnType() {
  20      return 'nonempty dict';
  21    }
  22  
  23    public function defineErrorTypes() {
  24      return array(
  25        'ERR_BAD_TASK' => 'No such maniphest task exists',
  26      );
  27    }
  28  
  29    protected function execute(ConduitAPIRequest $request) {
  30      $task_id = $request->getValue('task_id');
  31  
  32      $task = id(new ManiphestTaskQuery())
  33        ->setViewer($request->getUser())
  34        ->withIDs(array($task_id))
  35        ->executeOne();
  36      if (!$task) {
  37        throw new ConduitException('ERR_BAD_TASK');
  38      }
  39  
  40      return $this->buildTaskInfoDictionary($task);
  41    }
  42  
  43  }


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