Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F548413
ManiphestGetTaskTransactionsConduitAPIMethod.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
ManiphestGetTaskTransactionsConduitAPIMethod.php
View Options
<?php
final
class
ManiphestGetTaskTransactionsConduitAPIMethod
extends
ManiphestConduitAPIMethod
{
public
function
getAPIMethodName
()
{
return
'maniphest.gettasktransactions'
;
}
public
function
getMethodDescription
()
{
return
pht
(
'Retrieve Maniphest task transactions.'
);
}
protected
function
defineParamTypes
()
{
return
array
(
'ids'
=>
'required list<int>'
,
);
}
protected
function
defineReturnType
()
{
return
'nonempty list<dict<string, wild>>'
;
}
public
function
getMethodStatus
()
{
return
self
::
METHOD_STATUS_FROZEN
;
}
public
function
getMethodStatusDescription
()
{
return
pht
(
'This method is frozen and will eventually be deprecated. New code '
.
'should use "transaction.search" instead.'
);
}
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
();
$tasks
=
mpull
(
$tasks
,
null
,
'getPHID'
);
$transactions
=
array
();
if
(
$tasks
)
{
$transactions
=
id
(
new
ManiphestTransactionQuery
())
->
setViewer
(
$request
->
getUser
())
->
withObjectPHIDs
(
mpull
(
$tasks
,
'getPHID'
))
->
needComments
(
true
)
->
execute
();
}
foreach
(
$transactions
as
$transaction
)
{
$task_phid
=
$transaction
->
getObjectPHID
();
if
(
empty
(
$tasks
[
$task_phid
]))
{
continue
;
}
$task_id
=
$tasks
[
$task_phid
]->
getID
();
$comments
=
null
;
if
(
$transaction
->
hasComment
())
{
$comments
=
$transaction
->
getComment
()->
getContent
();
}
$results
[
$task_id
][]
=
array
(
'taskID'
=>
$task_id
,
'title'
=>
(
string
)
$transaction
->
getTitleForTextMail
(),
'transactionID'
=>
$transaction
->
getID
(),
'transactionPHID'
=>
$transaction
->
getPHID
(),
'transactionType'
=>
$transaction
->
getTransactionType
(),
'oldValue'
=>
$transaction
->
getOldValue
(),
'newValue'
=>
$transaction
->
getNewValue
(),
'meta'
=>
$transaction
->
getMetadata
(),
'comments'
=>
$comments
,
'authorPHID'
=>
$transaction
->
getAuthorPHID
(),
'dateCreated'
=>
$transaction
->
getDateCreated
(),
);
}
return
$results
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, May 12, 1:48 PM (1 d, 23 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
111218
Default Alt Text
ManiphestGetTaskTransactionsConduitAPIMethod.php (2 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment