1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-19 03:50:54 +01:00
phorge-phorge/src/applications/differential/conduit/DifferentialGetAllDiffsConduitAPIMethod.php
Joshua Spence 36e2d02d6e phtize all the things
Summary: `pht`ize a whole bunch of strings in rP.

Test Plan: Intense eyeballing.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: hach-que, Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D12797
2015-05-22 21:16:39 +10:00

57 lines
1.2 KiB
PHP

<?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 %s.',
'differential.querydiffs');
}
public function getMethodDescription() {
return pht('Load all diffs for given revisions from Differential.');
}
protected function defineParamTypes() {
return array(
'revision_ids' => 'required list<int>',
);
}
protected function defineReturnType() {
return 'dict';
}
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;
}
}