Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F96138691
DifferentialGetAllDiffsConduitAPIMethod.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, Dec 23, 01:21
Size
1 KB
Mime Type
text/x-php
Expires
Wed, Dec 25, 01:21 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
23130981
Attached To
rPH Phabricator
DifferentialGetAllDiffsConduitAPIMethod.php
View Options
<?php
final
class
DifferentialGetAllDiffsConduitAPIMethod
extends
DifferentialConduitAPIMethod
{
public
function
getAPIMethodName
()
{
return
'differential.getalldiffs'
;
}
public
function
getMethodStatus
()
{
return
self
::
METHOD_STATUS_DEPRECATED
;
}
public
function
getMethodStatusDescription
()
{
return
pht
(
'This method has been deprecated in favor of differential.querydiffs.'
);
}
public
function
getMethodDescription
()
{
return
'Load all diffs for given revisions from Differential.'
;
}
public
function
defineParamTypes
()
{
return
array
(
'revision_ids'
=>
'required list<int>'
,
);
}
public
function
defineReturnType
()
{
return
'dict'
;
}
public
function
defineErrorTypes
()
{
return
array
();
}
protected
function
execute
(
ConduitAPIRequest
$request
)
{
$results
=
array
();
$revision_ids
=
$request
->
getValue
(
'revision_ids'
);
if
(!
$revision_ids
)
{
return
$results
;
}
$diffs
=
id
(
new
DifferentialDiffQuery
())
->
setViewer
(
$request
->
getUser
())
->
withRevisionIDs
(
$revision_ids
)
->
execute
();
foreach
(
$diffs
as
$diff
)
{
$results
[]
=
array
(
'revision_id'
=>
$diff
->
getRevisionID
(),
'diff_id'
=>
$diff
->
getID
(),
);
}
return
$results
;
}
}
Event Timeline
Log In to Comment