Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/differential/conduit/DifferentialGetAllDiffsConduitAPIMethod.php
12256 views
1
<?php
2
3
final class DifferentialGetAllDiffsConduitAPIMethod
4
extends DifferentialConduitAPIMethod {
5
6
public function getAPIMethodName() {
7
return 'differential.getalldiffs';
8
}
9
10
public function getMethodStatus() {
11
return self::METHOD_STATUS_DEPRECATED;
12
}
13
14
public function getMethodStatusDescription() {
15
return pht(
16
'This method has been deprecated in favor of %s.',
17
'differential.querydiffs');
18
}
19
20
public function getMethodDescription() {
21
return pht('Load all diffs for given revisions from Differential.');
22
}
23
24
protected function defineParamTypes() {
25
return array(
26
'revision_ids' => 'required list<int>',
27
);
28
}
29
30
protected function defineReturnType() {
31
return 'dict';
32
}
33
34
protected function execute(ConduitAPIRequest $request) {
35
$results = array();
36
$revision_ids = $request->getValue('revision_ids');
37
38
if (!$revision_ids) {
39
return $results;
40
}
41
42
$diffs = id(new DifferentialDiffQuery())
43
->setViewer($request->getUser())
44
->withRevisionIDs($revision_ids)
45
->execute();
46
47
foreach ($diffs as $diff) {
48
$results[] = array(
49
'revision_id' => $diff->getRevisionID(),
50
'diff_id' => $diff->getID(),
51
);
52
}
53
54
return $results;
55
}
56
57
}
58
59