Generate file attachment transactions for explicit Remarkup attachments on common...
[phabricator.git] / src / applications / transactions / editfield / PhabricatorRemarkupEditField.php
bloba299aa0b5c149232d0196f607bcd700550bb6ed8
1 <?php
3 final class PhabricatorRemarkupEditField
4 extends PhabricatorEditField {
6 protected function newControl() {
7 return new PhabricatorRemarkupControl();
10 protected function newHTTPParameterType() {
11 return new AphrontRemarkupHTTPParameterType();
14 protected function newConduitParameterType() {
15 return new ConduitStringParameterType();
18 protected function newBulkParameterType() {
19 return new BulkRemarkupParameterType();
22 public function getValueForTransaction() {
23 $value = $this->getValue();
25 if ($value instanceof RemarkupValue) {
26 $value = $value->getCorpus();
29 return $value;
32 public function getMetadata() {
33 $defaults = array();
35 $value = $this->getValue();
36 if ($value instanceof RemarkupValue) {
37 $defaults['remarkup.control'] = $value->getMetadata();
40 $metadata = parent::getMetadata();
41 $metadata = $metadata + $defaults;
43 return $metadata;