Changeset View
Changeset View
Standalone View
Standalone View
src/aphront/httpparametertype/AphrontRemarkupHTTPParameterType.php
- This file was added.
<?php | |||||
final class AphrontRemarkupHTTPParameterType | |||||
extends AphrontHTTPParameterType { | |||||
protected function getParameterDefault() { | |||||
return $this->newRemarkupValue(); | |||||
} | |||||
protected function getParameterValue(AphrontRequest $request, $key) { | |||||
$corpus_key = $key; | |||||
$corpus_type = new AphrontStringHTTPParameterType(); | |||||
$corpus_value = $this->getValueWithType( | |||||
$corpus_type, | |||||
$request, | |||||
$corpus_key); | |||||
$metadata_key = $key.'_metadata'; | |||||
$metadata_type = new AphrontJSONHTTPParameterType(); | |||||
$metadata_value = $this->getValueWithType( | |||||
$metadata_type, | |||||
$request, | |||||
$metadata_key); | |||||
return $this->newRemarkupValue() | |||||
->setCorpus($corpus_value) | |||||
->setMetadata($metadata_value); | |||||
} | |||||
protected function getParameterTypeName() { | |||||
return 'string (remarkup)'; | |||||
} | |||||
protected function getParameterFormatDescriptions() { | |||||
return array( | |||||
pht('Remarkup text.'), | |||||
); | |||||
} | |||||
protected function getParameterExamples() { | |||||
return array( | |||||
'v=Lorem...', | |||||
); | |||||
} | |||||
private function newRemarkupValue() { | |||||
return new RemarkupValue(); | |||||
} | |||||
} |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0