Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F92696198
PhrequentPopConduitAPIMethod.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Nov 22, 21:04
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Nov 24, 21:04 (2 d)
Engine
blob
Format
Raw Data
Handle
22489039
Attached To
rPH Phabricator
PhrequentPopConduitAPIMethod.php
View Options
<?php
final
class
PhrequentPopConduitAPIMethod
extends
PhrequentConduitAPIMethod
{
public
function
getAPIMethodName
()
{
return
'phrequent.pop'
;
}
public
function
getMethodDescription
()
{
return
pht
(
'Stop tracking time on an object by popping it from the stack.'
);
}
public
function
getMethodStatus
()
{
return
self
::
METHOD_STATUS_UNSTABLE
;
}
public
function
defineParamTypes
()
{
return
array
(
'objectPHID'
=>
'phid'
,
'stopTime'
=>
'int'
,
'note'
=>
'string'
);
}
public
function
defineReturnType
()
{
return
'phid'
;
}
public
function
defineErrorTypes
()
{
return
array
(
);
}
protected
function
execute
(
ConduitAPIRequest
$request
)
{
$user
=
$request
->
getUser
();
$object_phid
=
$request
->
getValue
(
'objectPHID'
);
$timestamp
=
$request
->
getValue
(
'stopTime'
);
$note
=
$request
->
getValue
(
'note'
);
if
(
$timestamp
===
null
)
{
$timestamp
=
time
();
}
$editor
=
new
PhrequentTrackingEditor
();
if
(!
$object_phid
)
{
return
$editor
->
stopTrackingTop
(
$user
,
$timestamp
,
$note
);
}
else
{
return
$editor
->
stopTracking
(
$user
,
$object_phid
,
$timestamp
,
$note
);
}
}
}
Event Timeline
Log In to Comment