Differential D7326 Diff 23778 src/applications/phrequent/conduit/ConduitAPI_phrequent_tracking_Method.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/phrequent/conduit/ConduitAPI_phrequent_tracking_Method.php
- This file was added.
<?php | |||||
final class ConduitAPI_phrequent_tracking_Method | |||||
extends ConduitAPI_phrequent_Method { | |||||
public function getMethodDescription() { | |||||
return pht( | |||||
'Returns current objects being tracked in Phrequent.'); | |||||
} | |||||
public function getMethodStatus() { | |||||
return self::METHOD_STATUS_UNSTABLE; | |||||
} | |||||
public function defineParamTypes() { | |||||
return array(); | |||||
} | |||||
public function defineReturnType() { | |||||
return 'array'; | |||||
} | |||||
public function defineErrorTypes() { | |||||
return array( | |||||
); | |||||
} | |||||
protected function execute(ConduitAPIRequest $request) { | |||||
$user = $request->getUser(); | |||||
$times = id(new PhrequentUserTimeQuery()) | |||||
->setViewer($user) | |||||
->needPreemptingEvents(true) | |||||
->withUserPHIDs(array($user->getPHID())) | |||||
->execute(); | |||||
$now = time(); | |||||
$results = id(new PhrequentTimeBlock($times)) | |||||
->getCurrentWorkStack($now); | |||||
return array('data' => $results); | |||||
} | |||||
} | |||||
epriestley: This should probably return modern pagination stuff, but as long as we fix it before building… | |||||
Not Done Inline ActionsMaking this kind of stuff methods on the ranges is probably cleaner, at some point? Maybe getObjectTimeRanges() reuturns objects instead of a simple map or something. epriestley: Making this kind of stuff methods on the ranges is probably cleaner, at some point? Maybe… |
This should probably return modern pagination stuff, but as long as we fix it before building on top of it it's pretty whatever.