3 abstract class PhabricatorTokenizerEditField
4 extends PhabricatorPHIDListEditField
{
6 abstract protected function newDatasource();
8 protected function newControl() {
9 $control = id(new AphrontFormTokenizerControl())
10 ->setDatasource($this->newDatasource());
12 $initial_value = $this->getInitialValue();
13 if ($initial_value !== null) {
14 $control->setInitialValue($initial_value);
17 if ($this->getIsSingleValue()) {
18 $control->setLimit(1);
24 protected function getInitialValueFromSubmit(AphrontRequest
$request, $key) {
25 return $request->getArr($key.'.initial');
28 protected function newEditType() {
29 $type = parent
::newEditType();
31 $datasource = $this->newDatasource()
32 ->setViewer($this->getViewer());
33 $type->setDatasource($datasource);
38 protected function newCommentAction() {
39 $viewer = $this->getViewer();
41 $datasource = $this->newDatasource()
44 $action = id(new PhabricatorEditEngineTokenizerCommentAction())
45 ->setDatasource($datasource);
47 if ($this->getIsSingleValue()) {
51 $initial_value = $this->getInitialValue();
52 if ($initial_value !== null) {
53 $action->setInitialValue($initial_value);
59 protected function newBulkParameterType() {
60 $datasource = $this->newDatasource()
61 ->setViewer($this->getViewer());
63 if ($this->getIsSingleValue()) {
64 $datasource->setLimit(1);
67 return id(new BulkTokenizerParameterType())
68 ->setDatasource($datasource);