'optional list', 'limit' => 'optional int (default = 100)', ); } public function defineReturnType() { return 'nonempty list'; } public function defineErrorTypes() { return array(); } protected function execute(ConduitAPIRequest $request) { $query = new PhabricatorChatLogQuery(); $channel_ids = $request->getValue('channelIDs'); if ($channel_ids) { $query->withChannelIDs($channel_ids); } $limit = $request->getValue('limit'); if (!$limit) { $limit = 100; } $query->setLimit($limit); $logs = $query->execute(); $results = array(); foreach ($logs as $log) { $results[] = array( 'channelID' => $log->getChannelID(), 'epoch' => $log->getEpoch(), 'author' => $log->getAuthor(), 'type' => $log->getType(), 'message' => $log->getMessage(), 'loggedByPHID' => $log->getLoggedByPHID(), ); } return $results; } }