[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/src/applications/phrequent/conduit/ -> PhrequentTrackingConduitAPIMethod.php (source)

   1  <?php
   2  
   3  final class PhrequentTrackingConduitAPIMethod
   4    extends PhrequentConduitAPIMethod {
   5  
   6    public function getAPIMethodName() {
   7      return 'phrequent.tracking';
   8    }
   9  
  10    public function getMethodDescription() {
  11      return pht(
  12        'Returns current objects being tracked in Phrequent.');
  13    }
  14  
  15    public function getMethodStatus() {
  16      return self::METHOD_STATUS_UNSTABLE;
  17    }
  18  
  19    public function defineParamTypes() {
  20      return array();
  21    }
  22  
  23    public function defineReturnType() {
  24      return 'array';
  25    }
  26  
  27    public function defineErrorTypes() {
  28      return array(
  29      );
  30    }
  31  
  32    protected function execute(ConduitAPIRequest $request) {
  33      $user = $request->getUser();
  34  
  35      $times = id(new PhrequentUserTimeQuery())
  36        ->setViewer($user)
  37        ->needPreemptingEvents(true)
  38        ->withEnded(PhrequentUserTimeQuery::ENDED_NO)
  39        ->withUserPHIDs(array($user->getPHID()))
  40        ->execute();
  41  
  42      $now = time();
  43  
  44      $results = id(new PhrequentTimeBlock($times))
  45        ->getCurrentWorkStack($now);
  46  
  47      return array('data' => $results);
  48    }
  49  
  50  }


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