Differential D19558 Diff 46760 src/applications/diffusion/conduit/DiffusionGetRecentCommitsByPathConduitAPIMethod.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/conduit/DiffusionGetRecentCommitsByPathConduitAPIMethod.php
| Show All 17 Lines | protected function defineParamTypes() { | ||||
| return array( | return array( | ||||
| 'callsign' => 'required string', | 'callsign' => 'required string', | ||||
| 'path' => 'required string', | 'path' => 'required string', | ||||
| 'branch' => 'optional string', | 'branch' => 'optional string', | ||||
| 'limit' => 'optional int', | 'limit' => 'optional int', | ||||
| ); | ); | ||||
| } | } | ||||
| protected function defineErrorTypes() { | |||||
| return array( | |||||
| 'ERR_NOT_FOUND' => pht('Repository was not found.'), | |||||
| ); | |||||
| } | |||||
| protected function defineReturnType() { | protected function defineReturnType() { | ||||
| return 'nonempty list<string>'; | return 'nonempty list<string>'; | ||||
| } | } | ||||
| protected function execute(ConduitAPIRequest $request) { | protected function execute(ConduitAPIRequest $request) { | ||||
| $drequest = DiffusionRequest::newFromDictionary( | $drequest = DiffusionRequest::newFromDictionary( | ||||
| array( | array( | ||||
| 'user' => $request->getUser(), | 'user' => $request->getUser(), | ||||
| 'callsign' => $request->getValue('callsign'), | 'callsign' => $request->getValue('callsign'), | ||||
| 'path' => $request->getValue('path'), | 'path' => $request->getValue('path'), | ||||
| 'branch' => $request->getValue('branch'), | 'branch' => $request->getValue('branch'), | ||||
| )); | )); | ||||
| if ($drequest === null) { | |||||
| throw new ConduitException('ERR_NOT_FOUND'); | |||||
| } | |||||
| $limit = nonempty( | $limit = nonempty( | ||||
| $request->getValue('limit'), | $request->getValue('limit'), | ||||
| self::DEFAULT_LIMIT); | self::DEFAULT_LIMIT); | ||||
| $history_result = DiffusionQuery::callConduitWithDiffusionRequest( | $history_result = DiffusionQuery::callConduitWithDiffusionRequest( | ||||
| $request->getUser(), | $request->getUser(), | ||||
| $drequest, | $drequest, | ||||
| 'diffusion.historyquery', | 'diffusion.historyquery', | ||||
| Show All 20 Lines | |||||