id = $data['id']; } public function processRequest() { $request = $this->getRequest(); $author_phid = $request->getUser()->getPHID(); $handles = id(new PhabricatorObjectHandleData(array($author_phid))) ->loadHandles(); $factory = new DifferentialMarkupEngineFactory(); $engine = $factory->newDifferentialCommentMarkupEngine(); $comment = new DifferentialComment(); $comment->setContent($request->getStr('content')); $comment->setAction($request->getStr('action')); $comment->setAuthorPHID($author_phid); $view = new DifferentialRevisionCommentView(); $view->setComment($comment); $view->setHandles($handles); $view->setMarkupEngine($engine); $view->setPreview(true); $view->setTargetDiff(null); $draft = new PhabricatorDraft(); $draft ->setAuthorPHID($author_phid) ->setDraftKey('differential-comment-'.$this->id) ->setDraft($comment->getContent()) ->replace(); return id(new AphrontAjaxResponse()) ->setContent($view->render()); } }