Remove all "FileHasObject" edge reads and writes
[phabricator.git] / src / applications / phrequent / conduit / PhrequentTrackingConduitAPIMethod.php
blob4f73019544d50566cf8fa1f0e7f74af314d42f86
1 <?php
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() {
19 return array();
22 protected function defineReturnType() {
23 return 'array';
26 protected function execute(ConduitAPIRequest $request) {
27 $user = $request->getUser();
29 $times = id(new PhrequentUserTimeQuery())
30 ->setViewer($user)
31 ->needPreemptingEvents(true)
32 ->withEnded(PhrequentUserTimeQuery::ENDED_NO)
33 ->withUserPHIDs(array($user->getPHID()))
34 ->execute();
36 $now = time();
38 $results = id(new PhrequentTimeBlock($times))
39 ->getCurrentWorkStack($now);
41 return array('data' => $results);