2011-04-21 00:29:02 +02:00
|
|
|
<?php
|
|
|
|
|
Rename Conduit classes
Summary: Ref T5655. Rename Conduit classes and provide a `getAPIMethodName` method to declare the API method.
Test Plan:
```
> echo '{}' | arc --conduit-uri='http://phabricator.joshuaspence.com' call-conduit user.whoami
Waiting for JSON parameters on stdin...
{"error":null,"errorMessage":null,"response":{"phid":"PHID-USER-lioqffnwn6y475mu5ndb","userName":"josh","realName":"Joshua Spence","image":"http:\/\/phabricator.joshuaspence.com\/res\/1404425321T\/phabricator\/3eb28cd9\/rsrc\/image\/avatar.png","uri":"http:\/\/phabricator.joshuaspence.com\/p\/josh\/","roles":["admin","verified","approved","activated"]}}
```
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: epriestley, Korvin, hach-que
Maniphest Tasks: T5655
Differential Revision: https://secure.phabricator.com/D9991
2014-07-25 02:54:15 +02:00
|
|
|
final class DifferentialGetAllDiffsConduitAPIMethod
|
|
|
|
extends DifferentialConduitAPIMethod {
|
|
|
|
|
|
|
|
public function getAPIMethodName() {
|
|
|
|
return 'differential.getalldiffs';
|
|
|
|
}
|
2011-04-21 00:29:02 +02:00
|
|
|
|
2013-09-17 22:55:41 +02:00
|
|
|
public function getMethodStatus() {
|
|
|
|
return self::METHOD_STATUS_DEPRECATED;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getMethodStatusDescription() {
|
|
|
|
return pht(
|
2015-05-22 09:27:56 +02:00
|
|
|
'This method has been deprecated in favor of %s.',
|
|
|
|
'differential.querydiffs');
|
2013-09-17 22:55:41 +02:00
|
|
|
}
|
|
|
|
|
2011-04-21 00:29:02 +02:00
|
|
|
public function getMethodDescription() {
|
2015-05-22 09:27:56 +02:00
|
|
|
return pht('Load all diffs for given revisions from Differential.');
|
2011-04-21 00:29:02 +02:00
|
|
|
}
|
|
|
|
|
2015-04-13 00:59:07 +02:00
|
|
|
protected function defineParamTypes() {
|
2011-04-21 00:29:02 +02:00
|
|
|
return array(
|
|
|
|
'revision_ids' => 'required list<int>',
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2015-04-13 00:59:07 +02:00
|
|
|
protected function defineReturnType() {
|
2011-04-21 00:29:02 +02:00
|
|
|
return 'dict';
|
|
|
|
}
|
|
|
|
|
|
|
|
protected function execute(ConduitAPIRequest $request) {
|
|
|
|
$results = array();
|
|
|
|
$revision_ids = $request->getValue('revision_ids');
|
|
|
|
|
|
|
|
if (!$revision_ids) {
|
|
|
|
return $results;
|
|
|
|
}
|
|
|
|
|
2013-07-01 21:38:42 +02:00
|
|
|
$diffs = id(new DifferentialDiffQuery())
|
|
|
|
->setViewer($request->getUser())
|
|
|
|
->withRevisionIDs($revision_ids)
|
|
|
|
->execute();
|
2011-04-21 00:29:02 +02:00
|
|
|
|
|
|
|
foreach ($diffs as $diff) {
|
|
|
|
$results[] = array(
|
|
|
|
'revision_id' => $diff->getRevisionID(),
|
|
|
|
'diff_id' => $diff->getID(),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
return $results;
|
|
|
|
}
|
Rename Conduit classes
Summary: Ref T5655. Rename Conduit classes and provide a `getAPIMethodName` method to declare the API method.
Test Plan:
```
> echo '{}' | arc --conduit-uri='http://phabricator.joshuaspence.com' call-conduit user.whoami
Waiting for JSON parameters on stdin...
{"error":null,"errorMessage":null,"response":{"phid":"PHID-USER-lioqffnwn6y475mu5ndb","userName":"josh","realName":"Joshua Spence","image":"http:\/\/phabricator.joshuaspence.com\/res\/1404425321T\/phabricator\/3eb28cd9\/rsrc\/image\/avatar.png","uri":"http:\/\/phabricator.joshuaspence.com\/p\/josh\/","roles":["admin","verified","approved","activated"]}}
```
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: epriestley, Korvin, hach-que
Maniphest Tasks: T5655
Differential Revision: https://secure.phabricator.com/D9991
2014-07-25 02:54:15 +02:00
|
|
|
|
2011-04-21 00:29:02 +02:00
|
|
|
}
|