Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F99232774
ConduitAPI_differential_getrevisioncomments_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
Wed, Jan 22, 15:02
Size
1 KB
Mime Type
text/x-php
Expires
Fri, Jan 24, 15:02 (2 d)
Engine
blob
Format
Raw Data
Handle
23746496
Attached To
rPH Phabricator
ConduitAPI_differential_getrevisioncomments_Method.php
View Options
<?php
final
class
ConduitAPI_differential_getrevisioncomments_Method
extends
ConduitAPI_differential_Method
{
public
function
getMethodStatus
()
{
return
self
::
METHOD_STATUS_DEPRECATED
;
}
public
function
getMethodStatusDescription
()
{
return
pht
(
'Obsolete and doomed, see T2222.'
);
}
public
function
getMethodDescription
()
{
return
"Retrieve Differential Revision Comments."
;
}
public
function
defineParamTypes
()
{
return
array
(
'ids'
=>
'required list<int>'
,
'inlines'
=>
'optional bool (deprecated)'
,
);
}
public
function
defineReturnType
()
{
return
'nonempty list<dict<string, wild>>'
;
}
public
function
defineErrorTypes
()
{
return
array
(
);
}
protected
function
execute
(
ConduitAPIRequest
$request
)
{
$results
=
array
();
$revision_ids
=
$request
->
getValue
(
'ids'
);
if
(!
$revision_ids
)
{
return
$results
;
}
$revisions
=
id
(
new
DifferentialRevisionQuery
())
->
setViewer
(
$request
->
getUser
())
->
withIDs
(
$revision_ids
)
->
execute
();
if
(!
$revisions
)
{
return
$results
;
}
$comments
=
id
(
new
DifferentialCommentQuery
())
->
withRevisionPHIDs
(
mpull
(
$revisions
,
'getPHID'
))
->
execute
();
$revisions
=
mpull
(
$revisions
,
null
,
'getPHID'
);
foreach
(
$comments
as
$comment
)
{
$revision
=
idx
(
$revisions
,
$comment
->
getRevisionPHID
());
if
(!
$revision
)
{
continue
;
}
$result
=
array
(
'revisionID'
=>
$revision
->
getID
(),
'action'
=>
$comment
->
getAction
(),
'authorPHID'
=>
$comment
->
getAuthorPHID
(),
'dateCreated'
=>
$comment
->
getDateCreated
(),
'content'
=>
$comment
->
getContent
(),
);
$results
[
$revision
->
getID
()][]
=
$result
;
}
return
$results
;
}
}
Event Timeline
Log In to Comment