3 final class PhrequentTrackingConduitAPIMethod
4 extends PhrequentConduitAPIMethod
{
6 public function getAPIMethodName() {
7 return 'phrequent.tracking';
10 public function getMethodDescription() {
11 return pht('Returns current objects being tracked in Phrequent.');
14 public function getMethodStatus() {
15 return self
::METHOD_STATUS_UNSTABLE
;
18 protected function defineParamTypes() {
22 protected function defineReturnType() {
26 protected function execute(ConduitAPIRequest
$request) {
27 $user = $request->getUser();
29 $times = id(new PhrequentUserTimeQuery())
31 ->needPreemptingEvents(true)
32 ->withEnded(PhrequentUserTimeQuery
::ENDED_NO
)
33 ->withUserPHIDs(array($user->getPHID()))
38 $results = id(new PhrequentTimeBlock($times))
39 ->getCurrentWorkStack($now);
41 return array('data' => $results);