Changeset View
Changeset View
Standalone View
Standalone View
src/applications/paste/conduit/PasteCreateConduitAPIMethod.php
| Show All 38 Lines | protected function execute(ConduitAPIRequest $request) { | ||||
| $title = nonempty($title, pht('Masterwork From Distant Lands')); | $title = nonempty($title, pht('Masterwork From Distant Lands')); | ||||
| $language = nonempty($language, ''); | $language = nonempty($language, ''); | ||||
| $viewer = $request->getUser(); | $viewer = $request->getUser(); | ||||
| $paste = PhabricatorPaste::initializeNewPaste($viewer); | $paste = PhabricatorPaste::initializeNewPaste($viewer); | ||||
| $file = PhabricatorPasteEditor::initializeFileForPaste( | |||||
| $viewer, | |||||
| $title, | |||||
| $content); | |||||
| $xactions = array(); | $xactions = array(); | ||||
| $xactions[] = id(new PhabricatorPasteTransaction()) | $xactions[] = id(new PhabricatorPasteTransaction()) | ||||
| ->setTransactionType(PhabricatorPasteTransaction::TYPE_CONTENT) | ->setTransactionType(PhabricatorPasteTransaction::TYPE_CONTENT) | ||||
| ->setNewValue($file->getPHID()); | ->setNewValue($content); | ||||
| $xactions[] = id(new PhabricatorPasteTransaction()) | $xactions[] = id(new PhabricatorPasteTransaction()) | ||||
| ->setTransactionType(PhabricatorPasteTransaction::TYPE_TITLE) | ->setTransactionType(PhabricatorPasteTransaction::TYPE_TITLE) | ||||
| ->setNewValue($title); | ->setNewValue($title); | ||||
| $xactions[] = id(new PhabricatorPasteTransaction()) | $xactions[] = id(new PhabricatorPasteTransaction()) | ||||
| ->setTransactionType(PhabricatorPasteTransaction::TYPE_LANGUAGE) | ->setTransactionType(PhabricatorPasteTransaction::TYPE_LANGUAGE) | ||||
| ->setNewValue($language); | ->setNewValue($language); | ||||
| Show All 12 Lines | |||||