Differential D7326 Diff 23778 src/applications/phrequent/conduit/ConduitAPI_phrequent_push_Method.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/phrequent/conduit/ConduitAPI_phrequent_push_Method.php
- This file was added.
<?php | |||||
final class ConduitAPI_phrequent_push_Method | |||||
extends ConduitAPI_phrequent_Method { | |||||
public function getMethodDescription() { | |||||
return pht( | |||||
'Start tracking time on an object by '. | |||||
'pushing it on the tracking stack.'); | |||||
} | |||||
epriestley: pht() and linewrap | |||||
public function getMethodStatus() { | |||||
return self::METHOD_STATUS_UNSTABLE; | |||||
} | |||||
public function defineParamTypes() { | |||||
return array( | |||||
'objectPHID' => 'required phid', | |||||
'startTime' => 'int' | |||||
); | |||||
Not Done Inline ActionsobjectPHID epriestley: `objectPHID` | |||||
} | |||||
public function defineReturnType() { | |||||
Not Done Inline ActionsLikewise, maybe call this startTime. epriestley: Likewise, maybe call this `startTime`. | |||||
return 'phid'; | |||||
} | |||||
public function defineErrorTypes() { | |||||
return array( | |||||
); | |||||
} | |||||
protected function execute(ConduitAPIRequest $request) { | |||||
$user = $request->getUser(); | |||||
$object_phid = $request->getValue('objectPHID'); | |||||
$timestamp = $request->getValue('startTime'); | |||||
if ($timestamp === null) { | |||||
$timestamp = time(); | |||||
} | |||||
Not Done Inline Actionsphid, as above epriestley: `phid`, as above | |||||
$editor = new PhrequentTrackingEditor(); | |||||
return $editor->startTracking($user, $object_phid, $timestamp); | |||||
} | |||||
} |
pht() and linewrap