Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F122169081
DifferentialQueryDiffsConduitAPIMethod.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, Jul 16, 07:46
Size
1 KB
Mime Type
text/x-php
Expires
Fri, Jul 18, 07:46 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
27443792
Attached To
rPH Phabricator
DifferentialQueryDiffsConduitAPIMethod.php
View Options
<?php
final
class
DifferentialQueryDiffsConduitAPIMethod
extends
DifferentialConduitAPIMethod
{
public
function
getAPIMethodName
()
{
return
'differential.querydiffs'
;
}
public
function
getMethodDescription
()
{
return
pht
(
'Query differential diffs which match certain criteria.'
);
}
protected
function
defineParamTypes
()
{
return
array
(
'ids'
=>
'optional list<uint>'
,
'revisionIDs'
=>
'optional list<uint>'
,
);
}
protected
function
defineReturnType
()
{
return
'list<dict>'
;
}
protected
function
execute
(
ConduitAPIRequest
$request
)
{
$ids
=
$request
->
getValue
(
'ids'
,
array
());
$revision_ids
=
$request
->
getValue
(
'revisionIDs'
,
array
());
if
(!
$ids
&&
!
$revision_ids
)
{
// This method just returns nothing if you pass no constraints because
// pagination hadn't been invented yet in 2008 when this method was
// written.
return
array
();
}
$query
=
id
(
new
DifferentialDiffQuery
())
->
setViewer
(
$request
->
getUser
())
->
needChangesets
(
true
);
if
(
$ids
)
{
$query
->
withIDs
(
$ids
);
}
if
(
$revision_ids
)
{
$query
->
withRevisionIDs
(
$revision_ids
);
}
$diffs
=
$query
->
execute
();
return
mpull
(
$diffs
,
'getDiffDict'
,
'getID'
);
}
}
Event Timeline
Log In to Comment