3 final class PhrequentPopConduitAPIMethod
extends PhrequentConduitAPIMethod
{
5 public function getAPIMethodName() {
6 return 'phrequent.pop';
9 public function getMethodDescription() {
10 return pht('Stop tracking time on an object by popping it from the stack.');
13 public function getMethodStatus() {
14 return self
::METHOD_STATUS_UNSTABLE
;
17 protected function defineParamTypes() {
19 'objectPHID' => 'phid',
25 protected function defineReturnType() {
29 protected function execute(ConduitAPIRequest
$request) {
30 $user = $request->getUser();
31 $object_phid = $request->getValue('objectPHID');
32 $timestamp = $request->getValue('stopTime');
33 $note = $request->getValue('note');
34 if ($timestamp === null) {
38 $editor = new PhrequentTrackingEditor();
41 return $editor->stopTrackingTop($user, $timestamp, $note);
43 return $editor->stopTracking($user, $object_phid, $timestamp, $note);