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