Correct a parameter order swap in "diffusion.historyquery" for Mercurial
[phabricator.git] / src / applications / pholio / controller / PholioInlineListController.php
blob673a55bbaa481ac69784189dec17ed619c181d66
1 <?php
3 final class PholioInlineListController extends PholioController {
5 public function handleRequest(AphrontRequest $request) {
6 $viewer = $request->getViewer();
7 $id = $request->getURIData('id');
9 $image = id(new PholioImageQuery())
10 ->setViewer($viewer)
11 ->withIDs(array($id))
12 ->executeOne();
13 if (!$image) {
14 return new Aphront404Response();
17 $inline_comments = id(new PholioTransactionComment())->loadAllWhere(
18 'imageid = %d AND (transactionphid IS NOT NULL
19 OR (authorphid = %s AND transactionphid IS NULL))',
20 $id,
21 $viewer->getPHID());
23 $author_phids = mpull($inline_comments, 'getAuthorPHID');
24 $authors = $this->loadViewerHandles($author_phids);
26 $inlines = array();
27 foreach ($inline_comments as $inline_comment) {
28 $inlines[] = $inline_comment->toDictionary();
31 return id(new AphrontAjaxResponse())->setContent($inlines);