Changeset View
Changeset View
Standalone View
Standalone View
src/applications/feed/conduit/FeedQueryConduitAPIMethod.php
Show All 12 Lines | final class FeedQueryConduitAPIMethod extends FeedConduitAPIMethod { | ||||
public function getMethodDescription() { | public function getMethodDescription() { | ||||
return 'Query the feed for stories'; | return 'Query the feed for stories'; | ||||
} | } | ||||
private function getDefaultLimit() { | private function getDefaultLimit() { | ||||
return 100; | return 100; | ||||
} | } | ||||
public function defineParamTypes() { | protected function defineParamTypes() { | ||||
return array( | return array( | ||||
'filterPHIDs' => 'optional list <phid>', | 'filterPHIDs' => 'optional list <phid>', | ||||
'limit' => 'optional int (default '.$this->getDefaultLimit().')', | 'limit' => 'optional int (default '.$this->getDefaultLimit().')', | ||||
'after' => 'optional int', | 'after' => 'optional int', | ||||
'before' => 'optional int', | 'before' => 'optional int', | ||||
'view' => 'optional string (data, html, html-summary, text)', | 'view' => 'optional string (data, html, html-summary, text)', | ||||
); | ); | ||||
} | } | ||||
private function getSupportedViewTypes() { | private function getSupportedViewTypes() { | ||||
return array( | return array( | ||||
'html' => 'Full HTML presentation of story', | 'html' => 'Full HTML presentation of story', | ||||
'data' => 'Dictionary with various data of the story', | 'data' => 'Dictionary with various data of the story', | ||||
'html-summary' => 'Story contains only the title of the story', | 'html-summary' => 'Story contains only the title of the story', | ||||
'text' => 'Simple one-line plain text representation of story', | 'text' => 'Simple one-line plain text representation of story', | ||||
); | ); | ||||
} | } | ||||
public function defineErrorTypes() { | protected function defineErrorTypes() { | ||||
$view_types = array_keys($this->getSupportedViewTypes()); | $view_types = array_keys($this->getSupportedViewTypes()); | ||||
$view_types = implode(', ', $view_types); | $view_types = implode(', ', $view_types); | ||||
return array( | return array( | ||||
'ERR-UNKNOWN-TYPE' => | 'ERR-UNKNOWN-TYPE' => | ||||
'Unsupported view type, possibles are: '.$view_types, | 'Unsupported view type, possibles are: '.$view_types, | ||||
); | ); | ||||
} | } | ||||
public function defineReturnType() { | protected function defineReturnType() { | ||||
return 'nonempty dict'; | return 'nonempty dict'; | ||||
} | } | ||||
protected function execute(ConduitAPIRequest $request) { | protected function execute(ConduitAPIRequest $request) { | ||||
$results = array(); | $results = array(); | ||||
$user = $request->getUser(); | $user = $request->getUser(); | ||||
$view_type = $request->getValue('view'); | $view_type = $request->getValue('view'); | ||||
▲ Show 20 Lines • Show All 86 Lines • Show Last 20 Lines |