Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F121823284
ConduitAPI_maniphest_gettasktransactions_Method.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
Mon, Jul 14, 04:30
Size
1 KB
Mime Type
text/x-php
Expires
Wed, Jul 16, 04:30 (2 d)
Engine
blob
Format
Raw Data
Handle
27396849
Attached To
rPH Phabricator
ConduitAPI_maniphest_gettasktransactions_Method.php
View Options
<?php
/**
* @group maniphest
*/
final
class
ConduitAPI_maniphest_gettasktransactions_Method
extends
ConduitAPI_maniphest_Method
{
public
function
getMethodDescription
()
{
return
"Retrieve Maniphest Task Transactions."
;
}
public
function
defineParamTypes
()
{
return
array
(
'ids'
=>
'required list<int>'
,
);
}
public
function
defineReturnType
()
{
return
'nonempty list<dict<string, wild>>'
;
}
public
function
defineErrorTypes
()
{
return
array
(
);
}
protected
function
execute
(
ConduitAPIRequest
$request
)
{
$results
=
array
();
$task_ids
=
$request
->
getValue
(
'ids'
);
if
(!
$task_ids
)
{
return
$results
;
}
$tasks
=
id
(
new
ManiphestTaskQuery
())
->
setViewer
(
$request
->
getUser
())
->
withIDs
(
$task_ids
)
->
execute
();
$transactions
=
ManiphestLegacyTransactionQuery
::
loadByTasks
(
$request
->
getUser
(),
$tasks
);
foreach
(
$transactions
as
$transaction
)
{
$task_id
=
$transaction
->
getTaskID
();
if
(!
array_key_exists
(
$task_id
,
$results
))
{
$results
[
$task_id
]
=
array
();
}
$results
[
$task_id
][]
=
array
(
'taskID'
=>
$task_id
,
'transactionType'
=>
$transaction
->
getTransactionType
(),
'oldValue'
=>
$transaction
->
getOldValue
(),
'newValue'
=>
$transaction
->
getNewValue
(),
'comments'
=>
$transaction
->
getComments
(),
'authorPHID'
=>
$transaction
->
getAuthorPHID
(),
'dateCreated'
=>
$transaction
->
getDateCreated
(),
);
}
return
$results
;
}
}
Event Timeline
Log In to Comment