Differential D14607 Diff 35339 src/applications/transactions/edittype/PhabricatorCommentEditType.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/transactions/edittype/PhabricatorCommentEditType.php
| <?php | <?php | ||||
| final class PhabricatorCommentEditType extends PhabricatorEditType { | final class PhabricatorCommentEditType extends PhabricatorEditType { | ||||
| public function getValueType() { | public function getValueType() { | ||||
| return id(new AphrontStringHTTPParameterType())->getTypeName(); | return id(new AphrontStringHTTPParameterType())->getTypeName(); | ||||
| } | } | ||||
| public function generateTransaction( | public function generateTransactions( | ||||
| PhabricatorApplicationTransaction $template, | PhabricatorApplicationTransaction $template, | ||||
| array $spec) { | array $spec) { | ||||
| $comment = $template->getApplicationTransactionCommentObject() | $comment = $template->getApplicationTransactionCommentObject() | ||||
| ->setContent(idx($spec, 'value')); | ->setContent(idx($spec, 'value')); | ||||
| $template | $xaction = $this->newTransaction($template) | ||||
| ->setTransactionType($this->getTransactionType()) | |||||
| ->attachComment($comment); | ->attachComment($comment); | ||||
| foreach ($this->getMetadata() as $key => $value) { | return array($xaction); | ||||
| $template->setMetadataValue($key, $value); | |||||
| } | |||||
| return $template; | |||||
| } | } | ||||
| public function getValueDescription() { | public function getValueDescription() { | ||||
| return pht('Comment to add, formated as remarkup.'); | return pht('Comment to add, formated as remarkup.'); | ||||
| } | } | ||||
| } | } | ||||